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
- Need help with Query Loop. Need to get current taxonomy term and its posts and group them by a different selected taxonomy term
- How can I order a post query’s results based on the number of matching taxonomy terms?
- Custom wp_query inside a conditional stament inside a template part doesn’t work: why?
- Only show tag with the same id as the post
- How to add a shortcode function that returns the taxonomy slug of the actual post within the loop
- Query posts by post type, author and post meta
- Populate select list with meta values from all posts of a Custom Post Type
- Prevent Duplicate Post Counted by Query
- How can I have sticky posts while ALSO showing posts from a specific category using one WP_Query?
- display post count in archive page that have relation with another taxonomy term
- Filter for each loop when WP_Query has no posts to show
- Save queried result into database
- Duplice post with standard WP loop – fixed by using query_posts() instead
- How to use the Term Object from a custom select field in a query
- Custom Taxonomy – Modify Function to Get Child Category
- WP Query – grouping posts by same meta key, adding together values from another key
- Retrieve all custom field values of a specific custom field metakey as an array, inside WP_Query
- WP_Query breaking the loop in a nested loop
- ACF: How can I publish values of ACF fields in a loop while using wp_query?
- meta_query is overriding default search
- WP Query by 4 different taxonomies
- Trouble with serialized metadata
- wp_set_object_terms() custom taxonomy not working correctly when using insert post
- Categories In English version showing not canonical URL, instead shows query search result
- Can I alter the main loop to ‘orderby’ a custom callback?
- show most viewed post
- Excluded Custom Taxonomy Term Posts Displaying in loop
- Check the stored / cached WP_Query with transients on post change
- New template file does not load category-specific post
- Show a message if there are no active posts in category
- Show custom content when loop or wp query reaches specific time?
- Bootstrap grid while loop
- Related posts queries
- Comparing Meta Field date in WPQuery using Meta_Query?
- WooCommerce | AJAX | Product Pagination | Help me implement Ajax Pagination
- Related categories order posts by category
- Avoid removing duplicate posts
- WordPress – Form does not filter the results of taxonomies
- Loop through array of pages
- How to show specify category template for both parent and child category
- Getting posts by custom field value
- WP Query for all events prior to current date
- How to get taxonomy image attached to a Post Type WordPress
- Pagination inside the blog page not working
- list all post who have mutual taxonomy as current taxonomy!
- Count tags for current post and save into custom meta field (and update it on post edit)
- Query against multiple locations within single custom post type post
- Custom meta fields not showing up in WP_Response Object via custom endpoint
- How to display Woocommerce products list by tag
- Custom query for custom post type not getting correct post ID
- Create new Taxonomy, add extra fields, register terms AND extra fields values?
- Woocommerce featured products query no longer working
- how to get custom attachment url?