Comparison Operators not working for conditional author post thumbnails

You are using wrong Comparison Operators. Use else if($author_id == “2”) { instead of else if($author_id = “2”) { Edit: Try adding trailing slash after get_stylesheet_directory_uri function. its missing in your code. <img src=”https://wordpress.stackexchange.com/questions/166850/<?php echo get_stylesheet_directory_uri() ?>/images/default-thumb.jpg” alt=”” title=”” width=”” height=”” />

Unrestricted height thumbnails

According to add_image_size() you can do something like that with width but I imagine it works the same with height: $width (int) (optional) The post thumbnail width in pixels. Set to 9999 to resize based on $height Default: 0 Really I think you would want to set it to something ridiculously high which 9999 should … Read more

How risize a thumbnail?

You should define add_image_size with fourth parameter to allow WordPress to crop your image to exact size. add_image_size ( ‘single_post’, 500, 200, true); Whether to crop images to specified height and width or resize Difference between soft and hard crop false – Soft proportional crop mode. true – Hard crop mode. array – Specify positioning … Read more

Tweak next_post_link for it to include thumbnail

If you have a look at what next_post_link you’ll see that it takes a parameter $link as the second argument: next_post_link( $format, $link, $in_same_term = false, $excluded_terms=””, $taxonomy = ‘category’ ); Your parameter for this currently doesn’t include the post thumbnail: _x( ‘%title <span class=”meta-nav”>&rarr;</span>’, ‘Next post link’, ‘nicosite’ ) So we need to add … Read more

Get post thumbnail to display favorites

get_post_thumbnail_id() only returns the ID of the thumbnail. To get the actual thumbnail you could instead use get_the_post_thumbnail() You can also get the image using it´s ID, but that requires wp_get_attachment_image( get_post_thumbnail_id(), ‘full’ )