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

    (@jimtrue)

    You have to set a wp_config.php value to allow Shortcodes to be processed in Pods Templates, if you’re using Pods Templates. That’s discussed at the bottom of this article:

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

    If you’re calling it another way, ie, in PHP within your template, then we’d need to see how you’re creating the call for the shortcode. I personally, wouldn’t put the shortcode inside the content of another field. I’d just recreate the shortcode using the ASIN # as a field in my Custom Post Type.

    Thread Starter Nicola

    (@nicoleuk)

    This is how I’ve got it in my template <?php echo do_shortcode(“[pods field=’purchase’]”); ?>

    I have edited the wp-config file and it hasn’t made a difference.

    I also have the shortcode in the Pods field

    Not sure what you mean by recreating the shortcode. This is the shortcode I am trying to use [amazon template=thumbnail&asin=B0000536Y7]

    You can see it displayed here: https://popup-parlour.com/review/st-ives-apricot-scrub/

    Plugin Contributor Jim True

    (@jimtrue)

    Why are you calling a shortcode for a field within your post that includes another shortcode? That seems needlessly complex.

    What I’m suggesting is just modifying your post type to have a new text field amazon_code that would store only the ASIN # (the Amazon reference), like ‘B0000536Y7’ above.

    Then inside your PHP template, you could do something like this:

    <$php echo do_shortcode("[amazon template=thumbnail&asin=" . get_post_meta($post,'amazon_code',true) . "]"); ?>

    Or reasonably, since a Pods field is just post meta, you could just do:

    <?php echo get_post_meta($post,'purchase',true); ?>

    you can wrap that in a do_shortcode() if it’s still not working, but that takes Pods out of the equation, since you’re only storing post meta in purchase.

    Plugin Contributor Jim True

    (@jimtrue)

    That assumes the global $post for your loop, btw.

    Thread Starter Nicola

    (@nicoleuk)

    It’s because I like to have an entra field to add in the amazon product rather than include it with the content.

    Non of those suggestions have worked.

    I’m really not sure why the field can’t output a shortcode.

    Plugin Contributor Jim True

    (@jimtrue)

    As I’ve indicated above, you need to take the field out of the equation for the shortcode. Using a shortcode in a shortcode is a recipe for disaster. Simplify what you’re trying to do so it’s easier to troubleshoot. There’s no telling what else you may have that might be stepping in and causing an issue. You’re welcome to join our Slack Chat https://pods.io/chat/ and bring it to the #support channel and we can discuss. Going back and forth on the forums, more than 3 or 4 replies is usually detrimental to getting to the bottom of the issue.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Not displaying shortcodes’ is closed to new replies.