submit two file input fields in the same form

Here’s what I think is happening. I’ve added comments to the relevant sections of your code. // You use the $_FILES superglobal to get the uploaded files. if (isset($_FILES[‘file_metabox’])) { $file_metabox = $_FILES[‘file_metabox’]; foreach ($file_metabox[‘name’] as $key => $value) { if ($file_metabox[‘name’][$key]) { // … // Here you **overwrite** the $_FILES superglobal. $_FILES = array(“file_metabox” … Read more

Cron: Update four post at Hour

This code will call your function every hour. // The ‘if’ condition is needed to make sure the scheduler runs only once if ( ! wp_next_scheduled( ‘my_custom_action’ ) ){ wp_schedule_event( time(), ‘hourly’, ‘my_custom_action’ ); } // Here we create our own action to attach to the scheduler add_action( ‘my_custom_action’, ‘update_content’ ); It is also recommended … Read more

Display posts by alphabetical order

You can change the sort order on a category archive page to show posts by title (A-Z) by adding this code to your child theme’s functions.php: /* Sort posts by title for a specific category */ function change_category_order( $query ) { //Sort all posts from category with id=3 by title if($query->is_category(‘3’) && $query->is_main_query()){ $query->query_vars[‘orderby’] = … Read more