L
L
Lici2017-03-27 11:26:54
CMS
Lici, 2017-03-27 11:26:54

How to display text in wordpress only on site.com/ru/?

There is one site page site.com/ru/ and you need to put text on it below before the footer and you can’t do this through the admin panel, I just want to insert something like this into the footer:
IF URL PAGE = site.com/ru/ THAN ECHO" here is our text "
How to do it right?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
V
Vitaly, 2017-03-27
@Lici

In index.php paste

<?php
if ($_SERVER['REQUEST_URI'] == "/ru/"){
echo "Some text";
}
?>

J
Jan, 2017-03-27
@Yancheg

and you don't have WPML by any chance?

E
Eugene, 2017-03-27
@e_snegirev

<?= is_page('ru') ? 'Русский' : 'Не русский'; ?>

@
@ksider, 2017-03-27
_

well, write
for example jquery

var reffer =  window.location.href;
if (reffer.indexOf('site.com/ru/') != -1)  {
     $('body').prepend('<div class="">text</div>')   
    }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question