Problems using Shortcodes in Adverts SinglePost
-
Hi i have a problem with shortcodes inside the adverts single post
i’ve enabled the shortcodes by adding in the functions.php this code
add_filter( "adverts_the_content", "do_shortcode" );Then i’ve to display the shortcode so i do this:
<?php echo do_shortcode('[pms-restrict subscription_plans="1830483,1830470"]'); ?>This works, but this shortcode needs a “start” (the code above) and an end , which is [/pms-restrict]
I’ve to close my premium contents between these 2 shortcodes, like this:
[pms-restrict subscription_plans=”1830483,1830470″]
content
[/pms-restrict]Now, for the first shortcode, it works fine.. but looks like it doesn’t accept the “closing” shortcode
Because if i write:
<?php echo do_shortcode('[/pms-restrict]'); ?>on the singlepage i will see the text [/pms-restrict]
if i write:
<?php do_shortcode('[/pms-restrict]'); ?>i will see no effects, and the content will not be “closed” inside the shortcodes
That’s what i see on the singlepost advert page

as you can see, the “start” of the shortcode works.. because it correctly displays a sentence but , since it cannot understand when it finishes, i also see the “Download LIVE Wallpaper” , which i shouldn’t see before to login or register..
if i do that on a regular single post, i only see “this content is locked please login or register” then, after the login, i will not see this sentence anymore and i see the contents.
i need a way to make this code to work:
<?php echo do_shortcode('[/pms-restrict]'); ?>
The topic ‘Problems using Shortcodes in Adverts SinglePost’ is closed to new replies.