Custom Query include private posts in pagination count calculations?

If you’re running this custom query in place of the normal main query, you should instead alter the main query before posts are fetched, via the pre_get_posts action. This would go in your theme’s functions.php, or a custom plugin: function wpd_private_posts_in_categories( $query ) { if ( $query->is_category() && $query->is_main_query() ) { $query->set( ‘post_status’, array(‘private’, ‘publish’) … Read more

How to do a wp_query with two acf-fields, sorting on one of them

You are just confusing the array levels, ordering is not done inside the meta_query level but on the main query level. It is the difference between two classes: https://codex.wordpress.org/Class_Reference/WP_Query https://codex.wordpress.org/Class_Reference/WP_Meta_Query Also, as the meta query codex says: “Custom field value can be an array only when compare is ‘IN’, ‘NOT IN’, ‘BETWEEN’, or ‘NOT BETWEEN’”… … Read more