Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript WordPress loop: Hide images

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #34083
    Ash149
    Participant

    Hey,

    So working on a website and at the moment, I’ve got a loop which is just posting out the posts that I want, however I want to stop images from being included in the loop. But I still want the images to be their when you click onto the actual post, I’ve had a look online and found a few things that I tried but couldn’t seem to get working.

    I’m guessing their must be a way to do this? I’m running the latest version of wordpress.

    Thanks!

    Ashey

    #85698
    Brightonmike
    Member

    Could you not set up some kinda of custom field that just parses the text and ignores images? Then call the custom field instead of the content.

    #85699
    Ash149
    Participant

    Thanks Brightonmike, I’m not all that good with PHP at the moment, so let me just check, are you saying that if I create a custom field and call that instead of the content, then just put all the text of the post into the custom field?

    Thanks :)

    #85700
    Brightonmike
    Member

    You could do, yeah. I’m sure there’s a better option, but it’d work. The main downside is having to manually paste the test into a custom field.

    I haven’t done this myself btw, just an idea.

    #85711
    TheDoc
    Member

    Hmmmmm… you might be able to use this: http://codex.wordpress.org/Template_Tags/the_excerpt_rss

    #85726
    Kermet
    Member

    You could use a custom template and include the_content() into a div of some kind of id or class:

    and put in the css

    .mycustomclass img {
    display: none;
    }
    #85854
    Ash149
    Participant

    Thanks everyone for the responses, I will share what I have done to get it working later on incase anyone else is interested.

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.