do_shortcode in page template
-
Hi,
First of all, the plugin is awesome.
Really flexible and does exactly what you expect. Awesome job!I had a question though;
When adding shortcode in my editor / wysiwyg it works perfect, like this;[restrict role="subscriber" page="391"] MY RESTRICTED CONTENT [/restrict] [login-form]
The field was created with ACF, so I tried to add the shortcode in my page template as such;
<?php echo do_shortcode("[restrict role="subscriber" page="391"]"); ?> <?php if (get_field('portfolio_item')) : ?> <?php echo wp_kses_post(get_field('portfolio_item')) ?> <?php endif; ?> <?php echo do_shortcode("[/restrict][login-form]"); ?>
The code seems to break up and shows the content anyway and only 1 part of the code “[/restrict]”.
I want to add the shortcode in the page template, so the client won’t be able to mess it up by accident.
Am I missing something?Thanks!
Kind regards
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘do_shortcode in page template’ is closed to new replies.