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

Which PHP page is the Default Posts Page

home.php is the file in the WordPress template hierarchy which is used for the posts page. However, after looking at the Twentyseventeen theme code on GitHub, there is no home.php file provided which means the index.php will be used instead. Within index.php Twentyseventeen then uses get_template_part to seperate reusable sections of code. The most general … Read more

ACF not showing

the_field() function shows the value and it doesn’t get/return anything. Like the_title() and other template tags starting with the_. It means that: This line prints the value and $hero variable is empty. $hero = the_field(‘hero_title’); This line prints only <h1> tags. echo ‘<h1>’.$hero.'</h1>’; What you want is: echo ‘<h1>’ . get_field(‘hero_title’) . ‘</h1>’;