Support

Account

Home Forums ACF PRO ACF only showing on taxonomy archive page and not other category/post type archi

Unread

ACF only showing on taxonomy archive page and not other category/post type archi

    • gfreecd

    • October 13, 2020 at 9:21 am

    Hello,

    I’ve created a custom Post Type called Events and a custom taxonomy called Speaker Names. Each time I add a new event I will assign a speaker name to the event. I’m using ACF for event details and to assign additional info (Speaker Title, Headshot, Bio, etc.) to each speaker.

    The idea is to create an event and use ACF to select a Speaker (taxonomy) and it will show the custom fields (title, bio, headshot) based on that selection.

    Everything displays properly on the taxonomy archive pages (example.com/speakers/jon-doe) but I can’t get it to show on any other pages (example.com/category/events). Both pages are pulling the same code so I’m not sure what the difference is. I’m not seeing any errors… the data just isn’t showing. Do I need to do something else to get the data to show on other pages?

    I’m using the following rules for each Field Group.

    (EventDetails) – Post Type is equal to Events
    (SpeakerFields) – Taxonomy is equal to Speaker Name.

    I’m using the following code to call the fields.

    $term = get_queried_object();
    $title= get_field(‘speaker_title’);
    $headshot= get_field(‘speaker_headshot’, $term);
    $bio= get_field(‘speaker_bio’, $term);

    <div class=”title”><h3><?php echo $title; ?></h3></div>
    <div class=”headshot”>“></div>
    <div class=”bio”><h3><?php echo $bio; ?></h3></div>

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.