Query breaking with ‘posts_per_page’ => -1
Query breaking with ‘posts_per_page’ => -1
Query breaking with ‘posts_per_page’ => -1
You can order posts by meta value check out the codex https://codex.wordpress.org/Class_Reference/WP_Query
Figured it out. The solution was to include the tax query array inside another array: // tax_query needs to be an Array of an Array ‘tax_query’ => array( array( ‘taxonomy’ => ‘vodka_type’, ‘field’ => ‘slug’, ‘terms’ => $type, ), ),
You’ve tried with meta_query? $rooms = get_post_meta( $post->ID, ‘bedroom’, true ); $meta_query = array( array( ‘key’ => ‘bedroom’, ‘value’ => $rooms, ‘compare’ => ‘=’ ) ); WP_Query documentation on custom field parameters
I had a answer in development then I read what you were looking for some more. I will need more info before I can help. Is a reviewer/speaker a custom post type or a user? Is this relationship only going to be displayed on the article. Or will you also be displaying it on the … Read more
Since you are using single values anyway, how about trying just: $meta_SDate = get_post_meta($post->ID,’event_start_date’,true); $meta_EDate = get_post_meta($post->ID,’event_end_date’,true); Also note the following lines will need a space to separate the posted values so strtotime can work properly: $updStartD = strtotime(trim($_POST[‘event_start_date’]) . ‘ ‘ . trim($_POST[‘event_start_time’])); $updEndD = strtotime(trim($_POST[‘event_end_date’]) . ‘ ‘ . trim($_POST[‘event_end_time’])); I have added … Read more
You can use a tax query! This snippet also makes use of wp_list_pluck, a super handy function for “plucking” properties from an array of objects (in this case, getting an array of term IDs from an array of term objects): // Get current posts location term(s) $locations = get_the_terms( null, ‘location_taxonomy’ ); if ( $locations … Read more
I think your issue is with the rewrite portion when you registered the custom taxonomy with posts. ‘rewrite’ => array(‘slug’ => ‘some-slug’, ‘with_front’ => false) You can replace some-slug with anything you would like. It might be possible to replace it with article/event-category to get the results you want. Setting with_front to false removes blog … Read more
I think you already give the answer: use custom post types: define a custom post type per type coming in. Some notes for 2 way syncing: metadata property changes dont change the modification date, which might be handy to verify while syncing. Luckily you can add some callback for this e.g.: Example metadata fields changing … Read more
If I get this right each of your posts have one value of Exercise and one Value of Tempo? I would do the following probably: Build a list of exercises. For each exercise query query: 1 posts, ordered by Tempo, descending. This is probably as good as it gets staying within realm of WP API. … Read more