Using a Query Loop Block with Variables (Custom Meta)
Using a Query Loop Block with Variables (Custom Meta)
Using a Query Loop Block with Variables (Custom Meta)
Need to track the previous job title, and if it’s different, insert your line break. Untested: $prev_job_title = null; while ( $staff->have_posts() ) { $staff->the_post(); $job_title = get_post_meta( get_the_ID(), ‘job_title’, true ); if ( $prev_job_title !== $job_title ) { printf( ‘<h2>%s</h2>’, esc_html( $job_title ) ); $prev_job_title = $job_title; } // Staff markup. }
I’m not sure why you are getting errors but I can show you haw to defensively find and react to them. This is your code $rows = $wpdb->get_results($wpdb->prepare(“SELECT `rul_value` FROM ” . _ROLES_ . ” WHERE `rul_type` = %s AND `rul_value` LIKE %s”, ‘role’, ‘%intera%’)); foreach($rows as $row) { $singleParts .= $row->rul_value . “\n”; } … Read more
Post Query with Meta Query no longer working
Without really knowing everything about how you’ve set up your site, I can only offer a generic answer to your questions. If you have set up a way to save information to the database about who played which game and when, then you should be able to query those information. You can save data to … Read more
Changing the ‘orderby’ => ‘taxonomy’ to ‘orderby’ => ‘term_order’ should to the trick.
Same query args showing different results order when setting different number of posts
Given your detailed description, it seems you’ve taken several steps to address the issue of sorting your archive pages in WordPress. The fact that changing the “order”:”desc” to “asc” in the archives.html file of your theme didn’t yield the desired result suggests a deeper issue. Try this in your functions.php file: function wpb_modify_category_query( $query ) … Read more
WP_Query – Variable input
Include posts with a specific custom taxonomy term in author page