Nested Shortcodes inside Conditional Loop in TD Composer Header

Posted in: Newspaper
Post count: 108

Hi Guys, I use custom shortcodes to render conditional elements in tagDiv Composer such as category-specific web banners. These custom shortcodes are placed inside the text column shortcode as recommended by you in an earlier support ticket.

The shortcodes I’ve registered fetch a template part, inside which is a conditional statement to check the current category which then displays the relevant web banner shortcode. So my shortcode is a conditional loop file which checks the cat and returns an ad space using do_shortcode(‘[show_ad_space_1]’);

My shortcodes work fine when placed anywhere inside the main body container in tagDiv Composer but when trying to add them to the header template they don’t seem to render, and no ads are shown.

Is there anything which would stop them from working inside the header of the website?

Thanks
Matt

Post count: 35449

Hi,
The header has CPT format, but I believe that the condition is running only for the content if is header or footer is possible to not recognize it.
Now if you can provide a link with an example (with to have set the code in header and content to see how it is working) maybe we can understand why this is happening.
If you do not want to share those details here on forum, then you can contact us via email at contact@tagdiv.com and we’ll continue there.
Thank you!

Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.