Archived topic
limiting 'after content' hook only to blog posts
5 replies · Started by Moses on January 8, 2018
Hello
I'm using this code snippet in the 'after content' hook to display Elementor templates (signup form and related posts)
<?php if ( is_single() ) {
echo do_shortcode('[elementor-template id="1287"]');
} ?>
<?php if ( is_single() ) {
echo do_shortcode('[elementor-template id="1281"]');
} ?>
How can I limit them to appear only after blog posts? ATM they are showing at the bottom of single products too for example
http://nadyalobak.com/product/חוברת-השראה-לדרך/
http://nadyalobak.com/2018/01/07/טיפים-לחורף-נעים-חמים-ויצירתי/
Hi there,
Can you try excluding this?
https://docs.woocommerce.com/document/conditional-tags/#section-7
Not really sure how to add an exclude rule to the code :/ but it seems like what should be done
Try: <?php if ( is_single() && ! is_product() ) : ?>
More info here if you are interested: https://docs.generatepress.com/article/using-hooks-conditional-tags/
Leo the magician!
Thanks it worked perfectly!
No problem :)