How to display sticky post always at the top (before regular post) in wordpress?

I think you may need to add the feat_yes as a meta_key $temp_args = [ ‘post_type’ => array(‘current-channel’, ‘post’, ‘current-episodes’), ‘post_status’ => ‘publish’, ‘meta_key’ => ‘feat_yes’, ‘orderby’ => array( ‘meta_value_num’ => ‘ASC’, /* or ‘meta_value’ */ ‘post_type’ => ‘ASC’, ‘modified’ => ‘DESC’, ‘date’ => ‘DESC’), ‘posts_per_page’ => $data->{“no_articles_” . ICL_LANGUAGE_CODE}, ‘tax_query’ => [ [ ‘taxonomy’ … Read more

How can I use WP_Query to sort ‘event’ custom post type by date?

Found a ready made solution posted in the codex: https://developer.wordpress.org/reference/hooks/pre_get_posts/ The trick here is the pre_get_posts hook which modifies the query variable ‘after the query variable object is created, but before the actual query is run’ so that if the post type is an event, it sorts in the same way I’d been doing already. … Read more

How to display grandchildren only of custom post?

Solved my own question after further research and testing 🙂 Ended up using 2 queries passing the result from one query to the other. Hope this helps someone. $argsIssues = array( ‘post_type’ => ‘magazine’, ‘post_parent__in’ => array(20321), //get issue(children) posts from the issues(parent) ‘fields’ => ‘ids’ //query only the postIDs ); $q = get_posts( $argsIssues … Read more