Skip to content

Instantly share code, notes, and snippets.

@josesayago
Last active December 19, 2015 18:38
Show Gist options
  • Select an option

  • Save josesayago/5999763 to your computer and use it in GitHub Desktop.

Select an option

Save josesayago/5999763 to your computer and use it in GitHub Desktop.
Network Latest Posts placeholders blocks, change URL addresses at will.
<?php
/**
* This block is found in lines: 630 to 654
* and 848 to 872 from network-latest-posts.php file.
*/
// Put a placeholder with the post title
switch($thumbnail_filler) {
// 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;
case 'custom':
if( !empty( $thumbnail_url ) ) {
echo "<a href='".$all_permalinks[$field->guid]."'><img src='".$thumbnail_url."' alt='".$field->post_title."' title='".$field->post_title."' width='".$thumbnail_size[0]."' height='".$thumbnail_size[1]."' /></a>";
} else {
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;
// Boring by default ;)
default:
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;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment