• Resolved panosstavrianos

    (@panosstavrianos)


    Hello, i need some help here, in a template i have the following

    
    <?php echo do_shortcode( '[pods name="worksheet" template="post_list"]' ); ?> 
    
    [pods name="worksheet" template="post_list"]
    

    the first(with php) it’s working fine but the second it’s showing as plain text. I also try this shortcode in an article and it works…
    Thanks in advance!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Jory Hogeveen

    (@keraweb)

    Thread Starter panosstavrianos

    (@panosstavrianos)

    Hey, thanks for the quick response,
    I have added both the PODS_SHORTCODE_ALLOW_SUB_SHORTCODES and the add_filter already… I try the shortcodes=1 but it doesn’t seems to make a difference.

    I just try the shortcode in another template(for a ‘custom post type’) and it works there.
    The ‘problematic’ template is for an author’s page (User (extended) and set Automatic Pod Templates for this Pod).
    Is this the wrong way to use this plugin?

    BTW this plugin is amazing!

    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @panosstavrianos

    Sorry for my late reply!
    I tested running a shortcode for authors and came to the conclusion that Pods doesn’t handle shortcodes for auto-templates at all by default.
    It all depends on the hook you’ve chosen and whether this hook also runs shortcodes or not.
    So, for posts the default hook is the_content or the_exerpt which both run shortcodes by default.
    However, for author hooks the shortcodes aren’t run by default and thus the mentioned solution will not work.
    This also means that our documentation isn’t 100% correct.

    If you need shortcodes you need to add the do_shortcode callback to the hook you’ve chosen. Example, if you used the default get_the_author_description hook you’ll need to add the following:

    add_filter( 'get_the_author_description', 'do_shortcode' );

    Cheers, Jory

    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @panosstavrianos

    I’ve added the above to the documentation. Thank you for letting us know about this!

    Cheers, Jory

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Shortcode in template not working’ is closed to new replies.