WordPress.org

Ready to get started?Download WordPress

Forums

Exclude images from posts on homepage? (7 posts)

  1. nathanrp
    Member
    Posted 5 years ago #

    I am looking for a way to exclude images from my posts on the homepage in the_content. Any ideas?

  2. nathanrp
    Member
    Posted 5 years ago #

    Nevermind, figured it out.

  3. TheJacob
    Member
    Posted 5 years ago #

    How did you figure it out?

  4. TheJacob
    Member
    Posted 5 years ago #

    Hah, nevermind... figured it out. Weird.

    This is the goodluck post!

  5. gariben
    Member
    Posted 5 years ago #

    I hate when people ask for questions and then they figured out without giving any help to other people.

    What is the point of people helping you if you don't even help other people.

    At least tell us how it was fix instead of "nevermind"

  6. rushnmob
    Member
    Posted 5 years ago #

    I am needing help with this and unfortunatley, I haven't figured it out yet. Any help would be greatly appreciated.

    Thanks

  7. jaioxung
    Member
    Posted 4 years ago #

    I struggled for a while trying to come up with a way to do this using some complicated php but easiest way to do it is to use some CSS:

    In the loop place <?php the_content(); ?> inside a div like so:

    <div id="no_image"><?php the_content(); ?></div>

    Then in your CSS:

    #no_image img{
            display:none;
    }

Topic Closed

This topic has been closed to new replies.

About this Topic