• Resolved robhern135

    (@robhern135)


    Hello!

    I’m trying to use the restricted shortcodes to restrict entire parts of page templates as below. I consulted the docs but it’s not working, what am I doing wrong?

    <?php echo do_shortcode('[restricted]'); ?>
    /*code here */
    <?php echo do_shortcode('[/restricted]'); ?>
Viewing 1 replies (of 1 total)
  • Plugin Contributor etoilewebdesign

    (@etoilewebdesign)

    That is the correct way to use the WordPress do_shortcode method. You just have to make sure you’re inserting it in the right template and in the right place in that template. As we don’t know your theme or site, it would be hard for us to suggest exactly where you need to insert it. You need to find out which theme template controls the content you want to restrict and insert the do_shortcode in the correct places in that template.

Viewing 1 replies (of 1 total)

The topic ‘Shortcode in php in template file’ is closed to new replies.