WordPress.org

Support

Support » Installation » Don’t want images on my index-page, only in single posts

Don’t want images on my index-page, only in single posts

  • How can I exclude images on my index-page? I want to do this because I use avatar. I think it looks better when you only see an avatar instead of images included in the posts.

Viewing 2 replies - 1 through 2 (of 2 total)
  • See http://codex.wordpress.org/Conditional_Tags for how WordPress can test what type of page is being displayed. The is_home() tag tests for your index page.

    There’s a CSS option to this…

    You can set your <body> tag on the index page with a class – for example:

    <body class=”index”>

    Then, in the CSS file, put in soemthing like this:

    body#index img {display:none;}

    Any images on the index page will disappear. If you have images in the header, footer and all that, they’ll go away, too, so if you want to reduce it down to *only* images in posts, you can narrow it down further to the div id that is solely for your posts. For example, if the main content area has a div id of #content, you can do the following:

    body#index div#content img { display:none;}

    That’ll narrow it down to *only* images displayed on the index page, and located *within* the content area of your site.

    HTH!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Don’t want images on my index-page, only in single posts’ is closed to new replies.