get_field()
and have_rows()
work with post/term ID, not the whole “queried object“. You should try $term = get_queried_object()->term_id;
in line 1. Also it is unnecessery to set $term
again at line 3.
Related Posts:
- Show posts without term
- How to Filter Posts by Custom Fields?
- WordPress query with items from more than one selfdefined taxonomy as `term` argument
- Check if a post has term inside loop
- Display posts the match taxonomy term linked from wp_list_categoies?
- Group posts by custom field
- List taxonomy terms plus their latest post ordered by post date
- Querying by taxonomy vs Querying by Custom fields Speed Comparison
- How to show only one post for each categories of taxonomy of custom post that contains a specific custom field
- Get array of current post term ID’s
- Display link to taxonomy archive only if it has posts with certain custom field values
- wp_query to find posts by year and month
- Function get_queried_object() return NULL in custom taxonomy
- Querying on multiple taxonomies pulled from $_GET checkbox array not working?
- List custom taxonomy terms sharing posts with a term from a second custom taxonomy
- Orderby is working with one query but not with other
- Get a list of posts with associated meta_value
- Order by empty custom field
- How to order posts by title after they have already been sorted by category
- Search form not working with custom query?
- Post loop for all taxonomy terms
- Custom taxonomy.php not working
- Filter Custom Taxonomy Posts
- Conditional operator OR not working with custom fields
- How to add custom meta to ‘pre_get_terms’?
- get term id from term name
- WP_Query to output chosen term and posts with no term assigned
- WP Job Manager plugin – Listing only the twelve job categories on frontpage order by jobs they have
- WP ForLoop to compare meta information of posts to determine what post to display
- How to print term name inside wp post loop
- Query only displays one page_id
- Query Taxonomy By Page Title
- Query for specific taxonomy that executes a particular loop depending on volume of posts?
- How can I do a orderby by the number of items? So basically list by starting with the array with the largest number of post
- How to _GET multiple value checkbox WP_Query in Custom Toxonomy / Custom Fields
- How do I stop the same post showing multiple times in a archive?
- Get categories within specific term
- Problem with my loops
- How to define a custom hierarchy for terms?
- Custom loop – Isolating post meta output depending on current query taxonomy terms
- WP_Query to show post from a category OR custom field – Not 100% answered
- WP_Query a custom field value bringing back 0 results
- Custom search (wp query by custom fields)
- Loop through multiple custom fields with increasing number
- How do I display posts with specific value in a custom field into my loop?
- tax_query not working properly with get_posts
- taxonomy-{term}.php terms pagination returning 404 after a certain page
- get custom post type by tag
- Revolution Slider Orderby Two Custom Fields
- Get random terms
- Should unaltered default loop/query return a list of custom posts belonging to a custom taxonomy?
- Woocommerce custom loop to show all the products [closed]
- Why does the_content not work like others for a set post id?
- Pagination is broken and I need help fixing it
- Loop returning only 1 result
- WP_Query ignoring tax_query when is_singular
- Excluding pages in WP_query using ACF
- reset to main loop doesnt work
- Stuck in the query loop
- Query all posts if multiple meta key don’t exist
- Taxonomy order exception for specific term
- Include current post into loop
- wp_query to print posts if have X custom field value
- How to display the featured image for each post?
- Check for the main query from the template
- How to make posts unqueryable/unpublish posts where ACF relationship field is an unpublished post? [closed]
- How to order posts on each different category?
- Getting the post terms ‘wp_get_post_terms’ per post when within the functions.php file
- Get all posts with empty meta_value
- Loop 3 posts column wise and continue the loop into same columns
- How to Order By Two Custom Fields?
- Display specific page (that is child) content on parent page
- Comparing 2 Decimal Numbers from custom fields and displaying posts
- How to change the default post type over the loop?
- Query Not working as expected
- Determine if ID is page or post and query the ID
- get_the_terms has strange result since version 6.0
- How to display posts from custom post type category(custom Taxonomy) wise?
- get_children() Archive Template
- Prevent Duplicate Post Counted by Query
- Save queried result into database
- meta_query is overriding default search
- wp_set_object_terms() custom taxonomy not working correctly when using insert post
- Pagination inside the blog page not working
- Custom meta fields not showing up in WP_Response Object via custom endpoint
- Woocommerce featured products query no longer working
- Custom Query Pagination not working on static front page
- Remove Custom metabox from particular page template is used
- Adding additional taxonomies to wordpress taxonomy page
- WordPress loop add heading before first of type
- Retrieving category pages from subcategory returns empty sets
- Get newest value of an array
- Different number of posts showing in development vs production server
- new WP_query using custom fields
- query post based on comparison
- Storing/querying custom date data
- Multiple loop for “featured” items returns wrong posts
- Pagination in custom query not working [duplicate]
- query_posts problem – need help
- How to write a query-function as a query-shortcode?