V
V
Vladimir Litvinov2016-09-26 23:58:54
CMS
Vladimir Litvinov, 2016-09-26 23:58:54

How to show content only to authorized WordPress users?

It is necessary to register content closure for unauthorized users directly in the php file template, I found on the Internet only ways to close content through shortcodes, which does not work accordingly ((

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dmitry Grebenshchikov, 2016-09-27
@Buratino88

Hello. WP has a function is_user_logged_in() use it to create a shortcode that will display the content.

7
716 kittens, 2016-09-27
@716cats

You can make it even easier with the YITH WooCommerce Membership Premium plugin. Create at least a dozen user groups with different views.

O
ommunist, 2016-10-03
@ommunist

Set the_content() output condition depending on capability , like if ( current_user_can( 'subscriber' ) ) echo "Hi, dear ..."

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question