WordPress.org

Forums

Twenty Fourteen
[resolved] Hide featured image on pages, not posts (9 posts)

  1. loiborg
    Member
    Posted 1 year ago #

    Is there a way to not show the featured image on pages, while still showing it on posts? A tweakable setting per page could also be great.

    I need featured images on pages for thumbnails on the site, but the featured images are just too big for pages.

  2. Hannes Salen
    Member
    Posted 1 year ago #

    I use below code to show the featured image on single posts only, block it in category view except one category, this will probably work for pages as well ...

    .single .post-thumbnail img {
            display: block;
    }
    /*show featured image in single post view*/
    
    .category .post-thumbnail img {
            display: none;
    }
    /*hides featured image in category view*/
    
    .category-37 .post-thumbnail img {
            display: block;
    }
    /*unhides featured image in category 37*/
  3. loiborg
    Member
    Posted 1 year ago #

    Thanks for the reply, Hannes.

    It works great!

    .page .post-thumbnail img {
    display: none;
    }

  4. valgosais
    Member
    Posted 6 months ago #

    I'm using this code

    /*hides featured image in category view*/
    .category-50 .post-thumbnail img {
            display: none;
    }

    to hide the featured image of specific category in category view.

    I have a question:
    How do I hide featured image in single post view of specific category?

    Thanks

  5. Hannes Salen
    Member
    Posted 6 months ago #

    I'm not sure it will hide the featured images in single post view but maybe you can try:

    .category-37 .post-thumbnail img {
            display: none;
    }

    EDIT: Sorry, this doesn't help, it's the same code as what you posted with your question. I'm not sure I can help you with that!

  6. valgosais
    Member
    Posted 5 months ago #

    I solved it in this way:

    /*hides featured image in single post view of specific category*/
    .category-blogging-it img.wp-post-image {
            display: none;
    }
    .single-post .category-blogging-it .entry-header {
    	padding-top: 150px;
    }

    Of course blogging-it is the name of my category. I had to give the page some padding for better wiewing.

    Thanks though Hannas

  7. jbarragan
    Member
    Posted 5 months ago #

    Hello -
    I'm working on my personal website here at Dad Unfiltered, and I can't figure out how to stop the featured image (in a single post) from displaying on top of the blog page for every instance of a post (with a featured image set).

    Help?

  8. Hannes Salen
    Member
    Posted 5 months ago #

    If you go to your dashboard => appearance => customize, there you can choose featured content on the bottom. There you can set a custom tag for the featured posts, choose something else but featured and only the posts with this new tag should display on top of your blog page.

  9. valgosais
    Member
    Posted 5 months ago #

    Jbarragan, if i understand it correctly you want to hide the featured image of some post (in post view or category view?).

    I solved my problem by setting a specific category (blogging-it) to those post i want the featured image hidden, and then added these code to css:

    /*hides featured image in single post view of specific category*/
    .category-blogging-it img.wp-post-image {
            display: none;
    }
    /*hides featured image in category view*/
    .category-50 .post-thumbnail img {
            display: none;
    }

    of course blogging-it is the name of my category, and -50 is the id number of my blogging-it category. Did I help?

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic