It does not work concatenation in function.php

the_post_thumbnail() echoes data immediate, what you want to try is get_the_post_thumbnail() which returns data so that you may concatenate properly. WordPress core functions that are prefixed with the_ usually echo, those prefixed with get_ usually return. See: https://developer.wordpress.org/reference/functions/the_post_thumbnail/ https://developer.wordpress.org/reference/functions/get_the_post_thumbnail/

How to mass update custom fields for more than 20k posts

I just tested this and it works. <?php function toCall(){ global $wpdb; $togos = $wpdb->get_results(“SELECT * FROM $wpdb->postmeta WHERE meta_key=’_nelioefi_url'”); return $togos; } foreach (toCall() as $go) { global $wpdb; $wpdb->update( $wpdb->postmeta, array( ‘meta_key’ => ‘external_thumbnail’, // string // ‘column2’ => ‘value2’ // integer (number) ), array( ‘meta_id’ => $go->meta_id ) ); }; ?> You … Read more

height should be set to auto to avoid pixelation in the post thumbnail function

You can use a filter to remove height and width attributes from images, as explained in this CSS Tricks. Place the following in your themes functions.php file. add_filter( ‘post_thumbnail_html’, ‘remove_width_attribute’, 10 ); add_filter( ‘image_send_to_editor’, ‘remove_width_attribute’, 10 ); function remove_width_attribute( $html ) { $html = preg_replace( ‘/(width|height)=”\d*”\s/’, “”, $html ); return $html; }

Override has_post_thumbnail function

Yes, there is a way to do that… Let’s take a look at has_post_thumbnail function itself: function has_post_thumbnail( $post = null ) { return (bool) get_post_thumbnail_id( $post ); } As you can see, all it really does is getting post thumbnail ID and checking if it exists. But there are no filters in here. Let’s … Read more