Twenty Ten
[resolved] Hide images on homepage (3 posts)

  1. mugamugaw
    Posted 2 years ago #

    I just want to hide the images from the posts on the homepage. Like I want the users to have to click the post to be able to see the image. I know you can do this with the loop or with css but a very detailed step by step guide would be really helpful!

  2. paulwpxp
    Font hero
    Posted 2 years ago #

    First, make sure the posts don't have gallery post format assigned, AND then decide if you want to keep using the read more tag for all of your post. If so, use the read more tag to make the cut.

    If you don't want to use read more tag, then there are things to do.

    Make a child theme and override loop.php changing this line

    to this

    <?php if ( is_archive() || is_search() || is_home() ) :  ?>

    To avoid making a child theme, you could instead install a Custom CSS plugin

    and use this code to display none the images on archive and home.

    --------Hide images on archive------- */
    .format-gallery .gallery-thumb,
    .category-gallery .gallery-thumb,
    .home.blog #content .gallery,
    .home.blog #content img,
    .archive #content .gallery,
    .archive #content img,
    .search #content .gallery,
    .search #content img {
    	display: none;

    It does the job but not as clean, images not visible but still be there in the markup.

  3. mugamugaw
    Posted 2 years ago #

    Perfect! Thanks I appreciate it!

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic


No tags yet.