• Resolved meldenz

    (@meldenz)


    I have been trying to display one of the fields from my pods using shortcodes, but no matter what I do, it’s just not displaying in my Divi modules.

    I have added the below codes in my functions.php file as stated from one of the older inquiries.

    /**
    * Allow Pods Templates to use shortcodes
    *
    * NOTE: Will only work if the constant PODS_SHORTCODE_ALLOW_SUB_SHORTCODES is defined and set to
    true, which by default it IS NOT.
    */
    add_filter( 'pods_shortcode', function( $tags ) {
        $tags[ 'shortcodes' ] = true;
    
        return $tags;
    
    });

    Together with this one, on wp-config.php

    /** Allow Pods shortcode **/
    define('PODS_SHORTCODE_ALLOW_SUB_SHORTCODES', true);

    I have been trying to use the shortcodes since I need to use conditions. But for regular pods fields, I can display those using Divi Dynamic Content.

    From my Pods Template, I have this:

    [if listing_availability_type="1"]
    <span class="listing-availability-type {@listing_availability_type}">{@listing_availability_type}</span>
    [else]
    <span class="listing-availability-type {@listing_availability_type}">{@listing_availability_type}</span>
    [/if]

    So I just copied the same thing on my Divi text module, and instead of either giving me “available” or “waitlist” it’s printing the exact codes.

    Is there another way to be able to display Pods value with conditions? Or even just the template?

    Thank you so much in advance!

Viewing 1 replies (of 1 total)
  • Plugin Contributor Scott Kingsley Clark

    (@sc0ttkclark)

    This does not work for Divi text modules, this only works for Pods Templates. You can create a Pod Template and reference it from any Pods Shortcode, Pods Block, or Pods Widget for your purposes here.

Viewing 1 replies (of 1 total)
  • The topic ‘Unable to display Pods shortcode in Divi’ is closed to new replies.