A
A
Alexey Malikov2020-07-25 08:16:22
Content
Alexey Malikov, 2020-07-25 08:16:22

Content visibility based on user roles?

How to make a part of the content (button, link) on a Wordpress site visible to visitors and not visible to those who have registered (entered the site)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
mahmudchon, 2020-07-25
@Djey1

Use the is_user_logged_in function

<?php
if ( is_user_logged_in() ) {
    // логика для авторизованных
} else {
   // код для не вошедших
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question