How to use restriction in template?

[ad_1]

Hi.
I would like to add restriction on another place than just content inside posts.
For example custom field.
I call custom field meta in the template, so that would be something like this.

Currently I am using something like:

<?php if (pmpro_hasMembershipLevel(["2", "3", "4", "5"])) { ?>
<!-- You can access this. -->
<?php } else { ?>
<!-- You can not access. (Display: This content is for xxx and xxx members only.) -->
<?php } ?>

How to do this so that it checks per particular post which membership has rights and which does not?

  • This topic was modified 2 hours, 22 minutes ago by mllapan.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer