Custom order revolution sliders post base slides as inserted in Specific Posts List field

function modify_slider_order($query, $slider_id) { if($slider_id == 4) { // $ids=[16427,16557,16822,16507,16392,16548,16564,16426,16412,16404,16419,16421]; $query[‘orderby’] = ‘post__in’; // $query[‘orderby’] = array ( // ‘post__in’ => $ids, // ‘orderby’ => ‘post__in’, // ‘order’ => ‘ASC’ // ); } return $query; } add_filter(‘revslider_get_posts’, ‘modify_slider_order’, 10, 2); This solved my problem, I’m not sure why I don’t even have to pass IDs … Read more

WP_Query not returning custom post type

WP_Query does not accept a comma delimited string for the post_type argument, it must be one of either a string (for one post_type) or an array (for one-or-more post_type). $args = array( ‘post_type’ => ‘post’ ); $query = new WP_Query($args); OR $args = array( ‘post_type’ => array( ‘post’ ) ); $query = new WP_Query($args); OR … Read more

Ascending numerical sorting with non-numerical characters last

Try to modify your query args to this: $options[‘ind_start’] = array( ‘label’ => ‘Start Date (Earliest)’, ‘query_args’ => array( ‘meta_query’ => array( ‘start_date_query’ => array( ‘key’ => ‘start_date’, ‘compare’ => ‘EXISTS’, // Optional ), ) ) ); meta_query – will include only posts with any start_date value. Then add a WP query order filter: function … Read more

Help understand and create a loop with WP_query

Maybe the hanstholm in $args without the uppercase ? Also a problem with tax_query Don’t forget to use var_dump($query) for see what hapening. <?php $query = new WP_Query( array( ‘post_type’ => ‘hanstholm’, // name of post type. ‘tax_query’ => array( array( ‘taxonomy’ => ‘kategori’, // taxonomy name ‘field’ => ‘name’, // term_id, slug or name … Read more