Skip Navigation

[Resolved] Making a taxonomy image (custom field) appear in a custom post archive grid

This support ticket is created 4 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 8 replies, has 2 voices.

Last updated by mosesW 4 years, 7 months ago.

Assisted by: Shane.

Author
Posts
#1621381

I created a custom image field for a taxonomy, created a couple of taxonomies and added images.

Now I'm creating an archive. In this archive, I've added a 3 column grid. For the left-most column, I want to show the taxonomy image. How do I do this? If I use the Toolset image block it only gives me the option of the post's featured image or author image. If I choose a single field block, there is no option for the taxonomy field.

#1621771

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Moses,

Thank you for getting in touch.

Can you provide some clarity for me, is this a custom taxonomy archive ? Once you can confirm we can take it from there.

Thanks,
Shane

#1621825

It's an archive for a custom post type. I created this custom taxonomy to use with this custom post type.

#1623001

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Moses,

So you archive should show the image of the related taxonomy beside the post that the archive is listing correct?

This won't be possible with our Blocks plugin setup but I can guide you on how to do this with our Views plugin if you choose.

This will require that you have some basic html and css knowledge.

Please let me know if you want to go ahead with this.

Thanks,
Shane

#1623049

Sure, I'm interested to know how it'll work with the Views plugin. How will changing from Blocks to Views affect my site? If I switch to Views can I still use blocks?

#1624795

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Screenshot 2020-05-14 at 1.55.21 PM.png

Hi Moses,

Sorry for the delay in response.

How will changing from Blocks to Views affect my site?

Changing Views to blocks won't affect your site in any way as they are essentially the same plugin. You can actually get the views functionality in blocks by enabling the classic editor.

To do this go to Toolset -> Settings and scroll to editing experience and enable the 3rd option.

Refresh the page and you should now see the option Toolset -> Views.

Go to Toolset -> Views and create a new view and then set the view to display your taxonomy. This would under the Content Select, select Taxonomy and then select your taxonomy you want the view to display.

Scroll to the Query filter section and add a filter for Taxonomy Term. See Screenshot

Set the filter to "Set by the current post". Scroll to the Loop Editor and use the loop wizard to set your view to display the custom field that has the image.

Ensure that you've saved your taxonomy view.

Now go to your Custom Archive and insert a Field and Text block and then use the Views button to attach you Taxonomy view inside the custom archive loop.

Please let me know if this is clear or if further clarity is needed.

Thanks,
Shane

#1625069
toolset_q1.png

That works!!! Thank you so much! Your explanation was very clear and made perfect sense!

However, for some reason, when I inserted the taxonomy view in my custom archive using a Field and Text block, it inserted a <p></p> before and after the shortcode and when I sent to see the preview, there were some question marks inserted. (see attached).

I had to go into the HTML and delete the <p></p> then it looked better. Not sure why this happens.

#1625883

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Moses

Happy to see that you were able to get this working.

I suspect the issue is because the block is a wysiwyg block and could've added the formatting.

Hope this clears things up for you. If there are no further issues then you can go ahead and mark this ticket as resolved

Thanks
Shane

#1625899

My issue is resolved now. Thank you!