query posts in functions.php and update a field
You have to replace $post_id with get_the_id(); function status_alerts($query) { //start function global $post; // set the global $args = array( // all posts in the status post format ‘posts_per_page’ => -1, ‘taxonomy’ => ‘post_format’, ‘field’ => ‘slug’, ‘terms’ => array( ‘post-format-status’ ), ‘operator’=> ‘IN’ ); $alert_query = new WP_Query( $args ); while ( $alert_query->have_posts() … Read more