Site logo

[Support request] Add image on categories

Home Forums Support [Support request] Add image on categories

Home Forums Support Add image on categories

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #1606838
    Alfonso

    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!

    #1607147
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    You could create a new Hook Element and set it to generate_before_right_sidebar_content.

    Then add the ACF code to output the image.

    As for the empty categories, this should help: https://www.wpbeginner.com/wp-tutorials/how-to-show-empty-categories-in-wordpress/#:~:text=Inside%20our%20function%20we%20have,display%20empty%20categories%20as%20well.

    #1608826
    Alfonso

    Thank you Tom, but i don’t understand you.

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

    https://snipboard.io/oLqw6C.jpg

    Then I have ACF configured like this, isn’t it correct?

    https://snipboard.io/74uCp0.jpg

    Now, my category having a image:

    https://snipboard.io/OIfLBM.jpg

    #1608880
    Elvin
    Staff
    Customer Support

    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”.

    #1609144
    Alfonso

    Hi Elvin,

    I’ve added this shortcode: [acf field=”imagen”]

    but only get this:

    https://snipboard.io/EAfT8W.jpg

    The goal is to get my categories to display with your image, like this example:

    https://snipboard.io/5f9A3E.jpg

    #1609201
    Elvin
    Staff
    Customer Support

    https://snipboard.io/EAfT8W.jpg

    To verify: Is the Execute Shortcodes setting on the Hook Element checked? You have to check it so that the added shortcodes execute.
    https://docs.generatepress.com/article/hooks-element-overview/#settings

    #1609243
    Alfonso

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

    #1609250
    Elvin
    Staff
    Customer Support

    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.

    #1609259
    Alfonso

    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”

    #1609336
    David
    Staff
    Customer Support

    Hi there,

    are you wanting to display an image beside each of the category links ?

    If so then maybe this ACF topic will help:

    https://support.advancedcustomfields.com/forums/topic/category-list-with-thumbnails/

    #1609872
    Alfonso

    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’);

    #1610151
    David
    Staff
    Customer Support

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

    #1610520
    Alfonso

    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/

    #1610725
    David
    Staff
    Customer Support

    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.

Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.