WordPress.org

Ready to get started?Download WordPress

Forums

Network Latest Posts
[resolved] Custom fallback thumbnail (2 posts)

  1. ihavetoomany
    Member
    Posted 1 year ago #

    Maybe I missed something...but how would I go about adding my own custom thumbnail to posts that do not have one?

    http://wordpress.org/extend/plugins/network-latest-posts/

  2. Jose Luis SAYAGO
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    You could use the thumbnail_filler parameter to display a placeholder when thumbnails have not been set, check out this example: Thumbnails with Placeholders

    Nonetheless, you can't display personalized placeholders, right now your options are: placeholder (by default), kittens and puppies.

    Of course if you want your posts to display a thumbnail you have to set a featured image when you're editing a post.

    Finally if you want to edit the code to add your own placeholder provider, you could find and replace these lines:

    // Placeholder provided by Placehold.it
    case 'placeholder':
         echo "<a href='".$all_permalinks[$field->guid]."'><img src='http://placehold.it/".$thumbnail_wh."&text=".$field->post_title."' alt='".$field->post_title."' title='".$field->post_title."' /></a>";
         break;
    // Just for fun Kittens thanks to PlaceKitten
    case 'kittens':
         echo "<a href='".$all_permalinks[$field->guid]."'><img src='http://placekitten.com/".$thumbnail_size[0]."/".$thumbnail_size[1]."' alt='".$field->post_title."' title='".$field->post_title."' /></a>";
         break;
    // More fun Puppies thanks to PlaceDog
    case 'puppies':
         echo "<a href='".$all_permalinks[$field->guid]."'><img src='http://placedog.com/".$thumbnail_size[0]."/".$thumbnail_size[1]."' alt='".$field->post_title."' title='".$field->post_title."' /></a>";
         break;

    Just remember if you make changes to the code they will be erased when updating to a new version.

    Cheers.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.