wp_query – Exclude the first thumbnail from lazy loading on archives

Filters must always return a value. If you do not return a value, it’s the same as returning an empty value, null, etc. This is always the first parameter, or a modified/replacement version of it. So this: add_filter( ‘wp_get_attachment_image_attributes’, function( $attrs ) { if ( !is_single() && !is_page() && is_front_page() && is_archive() && is_search() ) … Read more

Put featured image under post title in admin area

add_action(‘admin_head-edit.php’, function(){ add_filter(‘the_title’, function( $title, $id ) { return $title . the_post_thumbnail( ‘thumbnail’ ); }, 100, 2); }); Will produce 2 images because there are two titles on custom posts, apparently. One that is hidden and one that isn’t. Adding the image markup to the hidden element will break the CSS that hides it. So … Read more