Support » Themes and Templates » Placeholder author graphic

  • Hi all,

    I am using the following code to pull in thumbnails that act as links to posts within a project I am working on:

    <a href="<?php the_permalink(); ?>"><img src="../wp-content/uploads/<?php the_title(); ?>.jpg" width="107px" height="75px"></a>

    As you can see this looks for a thumbnail which has the same name as the post that it will link to.

    Obviously for this to work there needs to be a jpg in the ‘uploads’ folder which has the same title as the required post. Does anyone know how I can amend the code, above, to show a default placeholder graphic if no jpg can be found that matches the title of the post?

    Hope that makes sense.

    Cheers.

  • The topic ‘Placeholder author graphic’ is closed to new replies.