You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 10, 2023. It is now read-only.
Using $acf = true on a term controller (for taxonomy term template like taxonomy-$taxonomy.blade.php) is returning the wrong fields for me.
It returns the loop first post fields instead of the actual term fields.
It works correctly if there is no posts in the loop (term with no linked posts).
I guess the issue comes from the use of ACF's get_fields() function, which needs more context to understand we are looking at a term and not a post type?
It looks like passing get_queried_object() as a second parameter fixes it, unsure if this is safe to do!
The text was updated successfully, but these errors were encountered:
Hey @thomascharbit yea, that is very much a ACF issue, however, I think in this case it's worth providing more context. I'll test out a get_queried_object() approach for taxonomies.
Using
$acf = true
on a term controller (for taxonomy term template like taxonomy-$taxonomy.blade.php) is returning the wrong fields for me.It returns the loop first post fields instead of the actual term fields.
It works correctly if there is no posts in the loop (term with no linked posts).
I guess the issue comes from the use of ACF's
get_fields()
function, which needs more context to understand we are looking at a term and not a post type?It looks like passing
get_queried_object()
as a second parameter fixes it, unsure if this is safe to do!The text was updated successfully, but these errors were encountered: