• Resolved mugamugaw

    (@mugamugaw)


    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!

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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
    https://themes.trac.www.ads-software.com/browser/twentyten/1.6/loop.php#L136

    to this

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

    To avoid making a child theme, you could instead install a Custom CSS plugin
    https://www.ads-software.com/plugins/search.php?q=custom+css

    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.

    Thread Starter mugamugaw

    (@mugamugaw)

    Perfect! Thanks I appreciate it!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hide images on homepage’ is closed to new replies.