WordPress.org

Ready to get started?Download WordPress

Forums

Don't want images on my index-page, only in single posts (3 posts)

  1. anothero
    Member
    Posted 8 years ago #

    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.

  2. ebusiness
    Member
    Posted 8 years ago #

    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.

  3. Doodlebee
    Member
    Posted 8 years ago #

    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!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.