Site logo

Archived topic

Add image on categories

13 replies · Started by Alfonso on January 5, 2021

Viewing posts 1–14 of 14

Hi there,

I’ve added a image to categories with ACF plugin, is possible to display it on my Archive blog sidebar?

https://www.delahuertacasa.com/blog/

And how i can display empty categories on sidebar??

Thanks!

I can create a hook, but What should I put inside?

https://snipboard.io/oLqw6C.jpg

You need to add the ACF shortcode that contains the image for the category on the code text area within the Hook element.

If you're not familiar with ACF shortcodes, refer to this documentation:
https://www.advancedcustomfields.com/resources/shortcode/

You then set the Hook Element's hook to generate_before_right_sidebar_content and set the display rule location to "All Archive".

Sorry, now "execute shortcode" is enabled but images are noy dispaying

Sorry, now “execute shortcode” is enabled but images are noy dispaying

Let's test if the shortcode works.

Can you try testing the same shortcode on a Shortcode block placed on content?

Does it display anything? Let us know.

I've added the shortcode at the end of my single post and is not working.

[acf field="imagen"]

My custom field is named "imagen"

Hi there,

I'm a bit lost on this.

I want to try another method following this documentation but it doesn't work either. I have added a snippet to activate the thumbnail button but nothing appears

Snippet with this code: add_theme_support('category-thumbnails');

Are you trying to add the images to the sidebar links - see example image ie. red boxes:

Yes but i can't do it.

The idea is to get this widget without plugins. To achieve this I had to install 2 plugins.

Now you can view at first time, categories without featured image or thumbnails and new widget with the same categories and his featured images.

https://www.delahuertacasa.com/blog/

The Category Widget that WordPress has built in doesn't have any filters, so there is no way to insert the category images in there.

The only way to do this is either a Plugin ( like Advanced Category Widgets ) or to have it Custom Developed. If the plugin works and provides the features you require then i would use the plugin.

This archived topic is closed to new replies.