WordPress.org

Support

Support » Themes and Templates » Twenty Fourteen » [Resolved] Hide featured image on pages, not posts

[Resolved] Hide featured image on pages, not posts

  • 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.

Viewing 8 replies - 1 through 8 (of 8 total)
  • 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*/

    Thanks for the reply, Hannes.

    It works great!

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

    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

    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!

    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

    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?

    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.

    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?

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Resolved] Hide featured image on pages, not posts’ is closed to new replies.
Skip to toolbar