Jump to content

  • Free consultations and support
  • Live chatClick Here for Live Chat
  • Call ico 1888-906-1888
    Phone support: Open

    Ready for your call :)

    Our business hours:

    Mon — Fri, 2am — 8pm (EST)

    US & EU support teams

    Phone support: Closed

    We are back in: 1h 20m

    Our business hours:

    Mon — Fri, 2am — 8pm (EST)

    US & EU support teams


Setting Default Featured Image in a WordPress website

default featured image wordpress

  • Please log in to reply
 

#1 OneDes

OneDes

    Senior Member

  • Designer
  • 282 posts

Posted 19 November 2013 - 01:34 AM

Sometimes it is nice to have a default featured image set. To set a default featured image or thumbnail you can use any of the below methods
1.By using the default featured image plugin
2.By manually add the necessary code in your theme’s file that displays the posts thumbnail such as index.php, single.php, home.php etc..)
This is the code you need to add
<?php if ( has_post_thumbnail() ) {
the_post_thumbnail();
} else { ?>
<img src="<?php bloginfo('yout_template_directory'); ?>/images/default-yourimage.jpg" alt="<?php your title(); ?>" />
<?php } ?>

Edited by OneDes, 19 November 2013 - 01:37 AM.






Also tagged with one or more of these keywords: default featured image, wordpress

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users