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
- Filter and list posts of a custom taxonomy
- How to list posts with disabled/closed comments, with pagination?
- How to make a second query offset -2 from current post
- Best choice for multiple loop in page?
- wp_query get data from advanced custom field in wordpress
- WP Query – order posts by meta field first and then order the rest
- Wp_query with 2 meta keys and array of meta values
- How to create custom query by keyword in post title?
- Create a loop on my pages with new “WP_Query”
- Having Issue on Ordering CPT by Custom Field In Custom WP Query
- How to filter query loop block with a search string from the query parameters
- Retrieve select tag custom values from array and display them in current page with wp_query?
- How to use a dropdown to filter posts by custom field
- Different Loop for tag pages?
- Querying a large number of posts including their custom fields data
- 2 queries with counters
- Custom Taxonomy dont save in a frontend form for post a custom post
- Search.php – return number of results but cannot loop through
- Creating ‘posts page’ loop based on the page itself
- Loop for custom-post-type comparing taxonomy terms for “related” posts?
- How to get the term description in a taxonomy term archive query?
- Can’t get term id for category archive
- Query multiple post types, but different order for each
- Order by the first array within a meta_query
- Query ACF relationship field – Comparator IN – Value array
- Show X taxonomies of the latest published posts
- Custom wp_query inside a conditional stament inside a template part doesn’t work: why?
- WP_Query breaking the loop in a nested loop
- Categories In English version showing not canonical URL, instead shows query search result
- Related posts queries
- Query against multiple locations within single custom post type post
- WP_Query, ACF field and array
- Order by Date Custom Field
- update_post_meta() not updating
- why default wordpress loop not working outside index.php
- how to show more than 1 post into three columns query
- How can I get all the posts that are related with a specific taxonomy term?
- How to combine nested tax_query logic with other nested query logic?
- tax_query not working for taxonomy slug
- active link for most recent post on vertical tabs
- custom query – offset to pagination
- Order Custom Field by Price
- Page displaying 1st post from a range of custom tax?
- WordPress WP_Query Array Custom search via taxonomies
- Display posts where date field matches current month?
- How ‘secure’ are loops?
- How to do a loop inside a loop?
- Main loop querying current template’s info only in custom category archive pages, not my posts
- How can I display sticky posts at first in wp_query?
- Custom query for certain post type OR another post type with a certain category
- Custom Taxonomy in custom REST API search
- Splitting query results, on the frontend, into separate sections based on meta value without multiple loops?
- Sort wp_query of two post types using meta datefield for one and date for the other – possible?