You aren’t looping through the results. Here is your code:
$m = new WP_Query( $myquery );
if ( $m->have_posts() ) : $m->the_post();?>
<ul><li <?php post_class();?>><a href="https://wordpress.stackexchange.com/questions/83409/<?php the_permalink(); ?>"><?php the_title(); ?></a></li></ul>
<?php endif;
wp_reset_postdata(); ?>
There is no Loop. You just check for the existence of posts, echo some information about the first one and quit. if
is not a Loop. It is a conditional. You need while
.
You need:
$m = new WP_Query( $myquery );
while ( $m->have_posts() ) : $m->the_post(); ?>
<ul><li <?php post_class();?>><a href="https://wordpress.stackexchange.com/questions/83409/<?php the_permalink(); ?>"><?php the_title(); ?></a></li></ul>
<?php endwhile;
wp_reset_postdata(); ?>
Related Posts:
- tax_query shows no results if nothing is selected
- get complex results set according to category structure
- wp_query with meta_query and tax_query
- list all post who have mutual taxonomy as current taxonomy!
- Why pagination is not working with tax_query param?
- In Product Category archives how to show Posts having same/similar prod_cat slug structure?
- List posts of terms but exclude one term
- Output ACF field dynamicaly within a taxonomy loop [closed]
- Nested meta_query with multiple relation keys
- Multiple relationship for multiple tax_query in WP_Query
- Conditional arguments for WP_Query and tax_query depending on if $somevar has a value
- Escaping WP_Query tax_query when term has special character(s)
- Does tax_query really beats meta_query in all situations?
- Tax_query terms ID’s using variable
- Why is my WP_Query not working when tax_query terms are an array?
- WP_query taxonomy + get all posts with two terms from same taxonomy
- SQL Statement generated by WP_Query not producing expected results
- Custom archive page based on array of categories and tags
- if wp_query taxonomy term have posts
- How to combine tax_query and date_query in WordPress
- Querying by taxonomy vs Querying by Custom fields Speed Comparison
- How to extend tag and category “Related Posts” query to custom post_type if the first 2 terms have no posts
- Using tax_query reverses my post_type argument in a custom WP_Query
- Find all product that contain terms with %keywords% in WP_Query
- Get term by custom term meta and taxonomy
- WP_Tax_Query with post_tag not working
- WP_Query tax_query problem
- How to add terms to my tax_query based off of the current post
- Query all posts in a given taxonomy
- Get image of latest post from taxonomies/categories
- Change default ordering of taxonomy terms – pre_get_terms
- tax_query OR with empty result returns all posts
- WP_Query, tax_query and term_meta: How to?
- Is it possible to dynamically get queried term AND taxonomy?
- Empty tax_query array returns an empty array
- How can i simulate “taxonomy__in” in query?
- Query Custom Post Type Order By Taxonomy Field
- Get list of terms that have posts in another term
- pre_get_posts Remove tax_query Completely
- Meta Query relation “AND” not working
- Tax query clause inside a meta query clause?
- Nested tax_query that allows specified categories OR tags, but NOT other categories
- Populate tax_query terms parameter with post term
- Fastest way of counting posts of a custom post type in a specific taxonomy term?
- Fetch posts that match term slug first two letters (wp query)
- Is it a good idea to improve meta query performance by adding tax query?
- WP_Query | Tax_Query Relation | Unable to use ‘OR’ as it then allows all products, help me finish my query?
- WP_Query tax query part of slug
- Taxonomy Query Relation field not behaving correctly?
- Tax query AND/OR meta query [duplicate]
- WordPress query with items from more than one selfdefined taxonomy as `term` argument
- Automatically Query Parent Taxonomy
- Query most popular terms by taxonomy over 2 week period
- Custom taxonomy.php not working
- Finding WordPress Posts assigned to multiple categories
- get all posts associated with a custom taxonomy
- Tax Query only returns for the first of several terms
- exclude product with available tag
- How to add tax_query to $args with concatenation
- How to print term name inside wp post loop
- Get posts in taxonomy randomly
- Loop posts based on permalink term
- How to search for meta_query LIKE or tax_query LIKE and grab these posts on search results?
- Is it possible to add relation between meta_query and tax_query?
- How to restrict search on a certain page to only return results against custom taxonomies?
- Function using get_posts() with tax_query not working when called from functions.php
- WP_Query tax_query – Show results if child has parent X
- Show multiple tax_query from 2 or more post_type in a single code
- Any quicker alternative for WP_Query “NOT IN”
- Tax Query on product_cat using NOT IN as operator does not exclude that category
- Facing problem with tax_query results
- Display related CPT with custom taxonomy
- WP Query should show No Posts when tax_query $args taxonomies don’t have associated posts
- WP_Query for a taxonomy value OR a custom post type meta field
- Select multiple categories with is_tax
- WordPress post_status and meta_query
- Query child posts with tax query on parents
- posts_per_page in a tax_query
- Tax_Query not working – connecting to second wordpress database
- Taxonomy archive, categorised by other taxonomy, not hiding empty taxonomies
- WordPress tax_query ignoring relation OR
- Optimal way to make tags in tax_query optional?
- in tax_query this Is the code correct? I need to access beginner video posts for different subject
- Combine Tax Archive and Meta_Query in WP_Query
- Taxonomy Terms That Don’t Exist Display Results
- Woocommerce orderby rand with tax_query not random
- Custom taxonomy and query multi conditions
- Object of class WP_Query could not be converted to int inside shortcode
- Escaping WP_Query tax_query when term has special character(s)
- Empty ‘terms’ in ‘tax_query’ returns an empty array
- Custom query for tag and custom tag from 2 post type
- WP_Query: Meta_Query with serialized value (or a workaround)
- Multiple tax_queries: display posts titles from several custom taxonomie
- Escaping WP_Query tax_query when term has special character(s)
- How to get hierarchical number of custom taxanomy
- Custom loop – Isolating post meta output depending on current query taxonomy terms
- Get the tax term in which is a post via wp_query
- Query posts filter not working
- WP_Query with tax_query not working
- Custom query with custom filtering returning incorrect results