Support

Account

Home Forums Front-end Issues Taxonomy image for custom post type

Helping

Taxonomy image for custom post type

  • I am using ACF for a number of field sets on a custom post type that I created, and I’ve created a layout template for that custom field type using Beaver Builder’s Themer plugin which lets me hook to ACF within the the layout template. That’s been working fine.

    However, I created an image ACF field and assigned it to a custom taxonomy that is associated with the custom post type. I assigned images (icons) to each of the taxonomy terms and am now trying to pull that into the custom post type layout.

    First, I’m trying to do that via BB, which offers to hook into post info (works for the taxonomy value text), or an ACF Post Field, ACF Post Author Field, ACF User Field, or ACF Option Field. I’ve tried both the ACF Post Field and ACF Option Field, but no image. I’m wondering if I need to add it via PHP to call the field?

    I’m also wondering if I should try to add CSS that calls the image via ::before on the taxonomy class, but been running into difficulties with that as well.

    Any thoughts or tips?

  • The image is related to the term that’s related to the post.

    Normally, in a template to get the value from the term your would do

    
    get_field('your_image_field_name', $term);
    

    where term is either the term object or a string that == "term_{$term_id}"

    I haven’t got a clue how you’d do that in Beaver Builder, I would probably ask them.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.