WP Query and multiple queries
WP Query and multiple queries
WP Query and multiple queries
How to debug none working search query?
Their is no real issue to fix this. After some researchs and test, I figured out that the way the person copy-pasted or wrote the titles was wrong with the ‘ Ciel d<del>’</del>Afrique et pattes de gazelle Versus the good way Ciel d<del>'</del>Afrique et pattes de gazelle Closing this tread.
After reading the documentation for multiple loops in one page here, I only had one WP_Query for both the loops. I stored the ID’s of all the posts from the desired category and check for them in the second loop and continue over them. Here’s the final code – first loop <?php $args = array( … Read more
Order 2 meta_queries differently in WP_Query?
Please use ‘meta_value’ => ‘meta_value_num’ instead of ‘AC’. You can also take help from documentation to see which parameters you can pass for order attribute in the query => https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters
You have miss the last parameter from get_post_meta(). Try below code: $literature = get_post_meta(get_the_ID(), ‘popis_literature’, true); It gives you array of IDs. E.g. array (size=2) 0 => string ‘32985’ (length=5) 1 => string ‘59956’ (length=5) So in query you can use them like: $args = array( ‘post_status’ => ‘published’, ‘posts_per_page’ => -1, ‘post_type’ => ‘post’, … Read more
How to get_comments() ordered by date and parent?
If you are still stuck, one possible alternative is to get all Post ID’s by the custom post type. You could try something like this: $the_query = new WP_Query( array( ‘post_type’ => ‘my-custom-post’, ‘posts_per_page’ => -1, ) )); while ( $the_query->have_posts() ) : $the_query->the_post(); the_ID(); endwhile; It would require you creating a custom post type, … Read more
It should be paged and not page ‘paged’ => $currentPage