Unable to display Pods shortcode in Divi
-
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!
- The topic ‘Unable to display Pods shortcode in Divi’ is closed to new replies.