Archived topic
after content hook content ONLY after posts ?
9 replies · Started by BarnaB on January 20, 2017
Hi
I created a WPSP list to be placed after the blog posts, but it shows up after the pages too...Is it possible to use this only after posts ?
Thanks
never mind just used it like soo :
<?php if ( is_single() ) : ?>
[wp_show_posts id="104113"]
<?php endif; ?>
and it only comes on on blog posts :)
Glad you found a solution!
Can i use this thread? How to not only use on posts but also postarchives?
Hi Jasper,
It would something like this:
<?php if ( is_single() || is_archive() ) : ?>
[wp_show_posts id=”104113″]
<?php endif; ?>
Let me know if this is what you are after.
thanks, last question: how do i define in a hook all pages except the home page, that is probably an easier solution for me
Is your home page the blog page or just a regular page?
The structure I used in this post should help:
https://generatepress.com/forums/topic/smartslider3/#post-279950
Have a look and let me know if need more help :)
If the home page is the blog:
<?php if ( ! is_home() ) : ?>
This content will show up everywhere except for the posts page
<?php endif; ?>
A static page:
<?php if ( ! is_front_page() ) : ?>
This content will show up everywhere except for the front page
<?php endif; ?>
Thanks!!
You're welcome :)