Answer the question
In order to leave comments, you need to log in
How to make certain information visible only for a certain user?
Good morning.
The task seems to be simple, but it seems not so.
For example, on the pages of the site, there is such information that should not be visible to visitors.
But they should not be visible, only from a specific user. '1' ('admin')
That is, for example:
<div>пусто</div>
<div>текст</div>
<?php
if ( is_author('admin') ) {
<div>пусто</div>
} else
if ( is_author('') ) {
<div>текст</div>
}
?>
Иван Пупкин - автор админ
Вася Дедкин - автор
Петя Папкин - автор
Иван Пупкин
год рождения
город
возраст
<?php the_author_meta('display_name'); ?>
where I can set <?php the_author_meta('display_name,-5'); ?>
, but unfortunately, the entire block and info is stylized, and it needs to be removed by another means. <?php если это автор поста - то выводить\не выводить {
кусок кода
}
?>
Answer the question
In order to leave comments, you need to log in
it is logical to assume that for this you will need to identify the user. And then check that it is this user who is contacting.
google cookies and sessions.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question