How to make thumbnail image fit into a div where image dimentions are completely different?

It may be that some of your images were uploaded before you created the custom image size function. If that’s the case, a plugin like Force Regenerate Thumbnails will solve your problem. Alternatively, for more versatility you could use the images as backgrounds, like so: <div style=”background-image: url(<?php the_post_thumbnail_url(); ?>)” id=”post-thumbnail”></div> and set the background … Read more

How to disable multiple thumbnail generation?

You can disable the medium and large image sizes by using the ‘intermediate_image_sizes’ filter: function remove_image_sizes($image_sizes){ foreach($image_sizes as $key => $size){ if($size == ‘large’ || $size == ‘medium’) unset($image_sizes[$key]); } return $image_sizes; } add_filter(‘intermediate_image_sizes’, ‘remove_image_sizes’, 12, 1); This skips adding these sizes and the options to insert a medium/large image are left blank in the … Read more

WP 3.4 has missing photo data

Having figured out the issue, I’d like to update this question. The issue stems from previous versions of WP not including the _wp_attached_file meta key when uploading media, which 3.4 now seems to require. Below is PHP code for looping through the database, verifying the presence of both the key and image file, then updating … Read more

Thumbnail and Featured Image With Fixed Sizes?

For this situation, you should use add_image_size. You can find more info about it in the codex. What add_image_size does is register new sizes for your thumbnails, so you can use them with the_post_thumbnail (and other functions). Here´s the example from the codex: if ( function_exists( ‘add_image_size’ ) ) { add_image_size( ‘category-thumb’, 300, 9999 ); … Read more

Underscores.me retrieve next / previous post thumbnail in post_nav function

I solved the problem by using get_the_post_thumbnail() instead of the variables $prevthumbnail and $nextthumbnail. function THEMENAME_post_nav() { // Don’t print empty markup if there’s nowhere to navigate. $previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, ”, true ); $next = get_adjacent_post( false, ”, false ); if ( ! $next && ! … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)