• Resolved john470fc

    (@john470fc)


    Hi, just reading the following which seems to describe my problem;

    http://pods.io/forums/topic/wordpress-shortcodes-in-template/

    So I’m trying to insert a shortcode from another plugin into a pods template with some success as follows;

    <?php echo do_shortcode(‘[gdrts_stars_rating type=”posts.pages” id=62]’); ?>

    This works fine, but I want to pull in the current post id using your magic tags, so I try this;

    <?php echo do_shortcode(‘[gdrts_stars_rating type=”posts.pages” id={@id}]’); ?>

    This does not work. Is what I am trying to do possible? Is there another way to do this?

    Best regards …

    https://wordpress.org/plugins/pods/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Jim True

    (@jimtrue)

    If you want magic tags to be processed (and shortcodes) without using PHP (which is why it’s not processing your Magic Tags), you need to use the following documentation, down at the bottom of the page:

    http://pods.io/docs/learn/shortcodes/pods/

    There’s a section called ‘Calling Shortcodes in Pods Templates’; that process you need to activate, both the wp_config.php changes and the addition to your functions.php

    Thread Starter john470fc

    (@john470fc)

    Hi Jim, thanks for your quick rely!

    I had seen that constant posted in another forum somewhere, but I did’t quite understand the logic. However, now I’ve read your documentation a couple of times (I must have overlooked that small part), I have what I need working. And without any php in the template (which I know you try to discourage).

    Many thanks!

    Plugin Contributor Jim True

    (@jimtrue)

    Glad to hear it’s working for you. We’ll try to highlight that better in the updated documentation, also to make it clearer. I think breaking the Shortcode document into multiple parts will make that somewhat clearer.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘WordPress shortcodes in Template’ is closed to new replies.