WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. mugamugaw
    Member
    Posted 10 months 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 10 months 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
    http://themes.trac.wordpress.org/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
    http://wordpress.org/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.

  3. mugamugaw
    Member
    Posted 10 months ago #

    Perfect! Thanks I appreciate it!

Reply

You must log in to post.

About this Theme

About this Topic

Tags

No tags yet.