Grab IDs of products from WP_Query which is run elsewhere
The most efficient approach: Just run the query again wherever you need it. Add this to the $args array: ‘fields’ => ‘ids’, $post_query->posts will only be an array of product ids.
The most efficient approach: Just run the query again wherever you need it. Add this to the $args array: ‘fields’ => ‘ids’, $post_query->posts will only be an array of product ids.
Slow Loading Times for Uncached Pages
To sort by title in ascending order (alphabetical order), you can use orderby => title and order => ASC: $args = array( ‘post_type’ => ‘marketing_en’, ‘orderby’ => ‘title’, ‘order’ => ‘ASC’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘custom_post_type’, ‘field’ => ‘slug’, ‘terms’ => array(ICL_LANGUAGE_CODE == ‘ar’ ? ‘tool-ar’ : ‘tool’), ), ), ); $loop = … Read more
Add css class ID to largest and smallest number a custom field in wp_query
Gutenberg block: add a multi-select for posts
Yes, but not by calling the_post twice in a loop. Instead, use 2 loops and rewind_posts. The first loop displays column1 and skips even posts. Then you call rewind_posts() to go back to the beginning. The second loop displays column2 and skips odd posts. After the first loop, call rewind_posts(); and it will rewind the … Read more
As for fixing the issue in question, you should first always check that $apiresults[$bb24rrid] is set, i.e. exists, and secondly, you should create an array which stores the posts that should go at the bottom and then merge it with the $exp_query->posts array, instead of pushing items in the foreach loop. // Array of posts … Read more
I ended up solving this on my own and thought I would come back to show my solution. On my taxonomy page I needed to get the current taxonomy term like so: <?php $term = get_queried_object(); if (get_field(‘subtitle’, $term)) { ?> <p><?php the_field( ‘subtitle’, $term )?></p> <?php } ?> Here is the documentation page: https://www.advancedcustomfields.com/resources/adding-fields-taxonomy-term/
Use Custom Field to Display Post Loop
How to assign a single-menu-template to a menu-items in a taxony/ cat/ subcat/ subcat-item