Site logo

Archived topic

after content hook content ONLY after posts ?

9 replies · Started by BarnaB on January 20, 2017

Viewing posts 1–10 of 10

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

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 :)

This archived topic is closed to new replies.