Post thumbnail won’t resize to fit
change true to false in set_post_thumbnail_size( 760, 330, true ) add_theme_support( ‘post-thumbnails’ ); set_post_thumbnail_size( 760, 330, false ); This will make it not crop automatically.
change true to false in set_post_thumbnail_size( 760, 330, true ) add_theme_support( ‘post-thumbnails’ ); set_post_thumbnail_size( 760, 330, false ); This will make it not crop automatically.
According to Codex Embeds documentation: It also allows you to set a maximum (but not fixed) width and height, like so: For the_post_thumbnail() you arguments usage seems wrong, $size is first argument and it doesn’t come in that format ( the_post_thumbnail( array( 240, 170 ); ).
the_post_thumbnail allows for size specificiations. So you would do: <?php the_post_thumbnail(‘medium’); ?> if you changed the image dimensions in the admin, you will need to go back and re-upload the images so they crop to the correct size that you set up If the issue is the dimensions of the image you are probably looking … Read more
So the quickest and easiest way to resolve this is to add and run the plugin Regenerate Thumbnails as Pieter Goosen suggested. Back up your db first!
well, what i did finally is to use taxonomies instead of aggregation because cron based solutions are a little bit tricky with server resources and might reduce the performance: install taxonomies plugin add a code to it to attach the blogid of the post as custom field when saving the post add a function to … Read more
While looking at some code for another issue I had a lightbulb went off in my head and brought me back to this problem. So after several tries at it I came up with this… function add_image_to_feed( $thumbz){ if( is_feed() ){ $def_thmb = get_post_meta( get_the_ID(),’def_thmb’,true); $subPath = tube_sub_dir_path(get_the_ID()); $upload_dir = wp_upload_dir(); $thumb_ur = $upload_dir[baseurl].”/tube-thumbs/”.$subPath.””; $thumbz … Read more
Can’t update/save featured image
I had the same problem after I moved one of my sites. The best solution I could come up with was to delete all of the database entries for my media (open the wp-posts table, search for all entries with a post_type of attachment and delete them. Then install the plugin Add from Server and … Read more
Lazy Load sometimes don’t work
Check out get_the_post_thumbnail() $image_thumb = get_the_post_thumbnail( get_the_ID(), ‘thumbnail’); Here’s a more specific example: while (have_posts()) : the_post(); echo ‘<article class=”search-entry clearfix”>’; $image_thumb = get_the_post_thumbnail( get_the_ID(), ‘thumbnail’); echo ( $image_thumb ) ? sprintf(‘<a href=”https://wordpress.stackexchange.com/questions/168885/%s” title=”https://wordpress.stackexchange.com/questions/168885/%s” class=”search-portfolio-thumb”>%s</a>’, get_permalink(), get_the_title(), $image_thumb) : ”;