WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Require a Simple PHP (!) if-else code... I think! (3 posts)

  1. subminor
    Member
    Posted 2 years ago #

    Hi,

    The blog section on my website currently shows a thumbnail if you attach a featured image. What I want to happen is for an 'Image not available' image to display if there is no set featured image.

    I am a newbie to php so with a few trials and lots of errors still couldn't manage it. From what I can tell, this is the piece of code I need to change from the loop-entry.php code:

    [Mangled code removed. Please post code between backticks or use the code button]

    I'm assuming I need something 'else' to tell it to display an image from a fixed url.
    Any help appreciated.

    Thanks

  2. Ryan Paul
    Member
    Posted 2 years ago #

    The following page gives a perfect example of what you need.

    http://codex.wordpress.org/Function_Reference/has_post_thumbnail

  3. subminor
    Member
    Posted 2 years ago #

    Yep.. Thats perfect. Thanks.

    :D

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.