Query posts by Post title

That query has nothing to do with ACF. It’s a regular post query using WordPress’ standard query class. As such you can refer to the documentation for the options for ordering your query. To sort by post title you just need to set orderby to title: <?php $args = array( ‘posts_per_page’ => 999, ‘post_type’ => … Read more

How to pass query string vars between admin pages?

I did some more nosing around in Stack Exchange, and found this previous question. it has no accepted answers, but a few of the replies gave specific instructions on how to pass variables to admin pages (the approach is different than doing so on front-end pages). I tried the $_GET[] method, and it worked.

Multiple pagename WP Query

For multiple slugs, you can use post_name__in: new WP_Query( array( ‘post_name__in’ => array( ‘accommodation’,’activities’,’restaurant’ ), ) ); For multiple post IDs, you can use post__in: new WP_Query( array( ‘post__in’ => array( 1, 2, 3 ), ) ); You can check the Codex for more details.

Issues with search after added meta_query

There is one problem with your query. You assume, that it will use OR relation to all query parts. But it won’t. The OR operator will be used only for meta_query parts. It means, that your query is looking for posts that are matching these criteria: (post_title LIKE query) AND ( ean LIKE query OR … Read more

Getting the post terms ‘wp_get_post_terms’ per post when within the functions.php file

(Revised answer) So I’m assuming that there are actually posts in the category (ID: 31), and based on the wp_get_post_terms() reference: $post_id (int) (Optional) The Post ID. Does not default to the ID of the global $post. Default 0. It’s likely that you’re not passing the proper post ID to the wp_get_post_terms() function: wp_get_post_terms( $post->ID, … Read more