0
votes

I'm using a template called 'expression' for Wordpress which works fine. I'd just like to tweak it a little. I have a page that shows all my blog posts, and ofcourse each blog post has an own overview if you click on it.

on each blog post you make, you can set a featured image. This image is shown on the overview page, and on each individual detailed view of 1 blog post. I'm trying to find a way to only show this featured image on the overview page of all blogs, and not on the detailed view of a blog post.

Is there a way to do this?

I tried to edit the code in post-template.php by adding:

ispage('blog')

full code:

if(has_post_thumbnail() && !$hide_thumbnail && !is_page('blog')){ ?>
    <div class="blog-post-img">
        <?php if(!is_single()){?>
    <a href="<?php the_permalink(); ?>"> 
    <?php }
    $img_id=$pex_page->layout=='full'?'post_box_img_full':'post_box_img';
    the_post_thumbnail($img_id);

     if(!is_single()){
     ?>
    </a>
    <?php } ?>
    </div>
    <?php 
}

this works, but both featured images will be gone. which is not what I wanted. Thanks for your help!

1
please accept your answer, there should be a hollow checkmark next to the answer. This tells us it solves the issue without having to guess - Ryan B

1 Answers

0
votes

Got it eventually,

you have to use:

is_single();

instead of :

is_page();

Thanks anyway.