Generate theme: Front page shows both the featured image and the in-post image

Community Forums Forums General Discussion Generate theme: Front page shows both the featured image and the in-post image

This topic is: not resolved

This topic contains 3 replies, has 2 voices, and was last updated by  TimoKiander 4 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #102863

    TimoKiander
    Member
    Post count: 8

    Hi!

    Is there a way to filter out the in-post image on the front page of Generate theme?

    In addition of using the featured image, I’m also using an in-post image in my blog posts. However, this image is also displayed within a small excerpt that shows on the front page.

    Sorry, the blog is under maintenance, so I can’t give you the URL right now.

    Cheers,
    Timo

    #103171

    JanHoek
    Member
    Post count: 212

    Try to put this in your functions.php

    add_filter('the_content','image_content_filter',11);
     
    function image_content_filter($content){
     
        if (is_home() || is_front_page()){
          $content = preg_replace("/<img[^>]+\>/i", "", $content);
        }
     
        return $content;
    }

    Hi, my name is Jan Hoek. Sure, they all say I have a big head, but I like to think it’s way too small for all my ideas.

    #103211

    TimoKiander
    Member
    Post count: 8

    Hi Jan!

    Ok, thanks!

    Cheers,
    Timo

    #103215

    TimoKiander
    Member
    Post count: 8

    Ok, so there is something fishy going on …

    Now the front page shows no featured images at all, only the in-post image inside a post.

    I’d like a featured image on the front page and then just a post picture inside the post.

    If I choose Include Featured Image option Under Genesis – Theme Settings, the featured image displays nicely on the front page, but it also shows inside the post, with the post image.

    It’s like, this situation has turned around. Now the duplicate image issue is inside the post.

    Any ideas what to do next?

    Cheers,
    Timo

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.