Support » Fixing WordPress » Add an image to category

  • bondigor69


    Hey guys I would like to get help.
    What I want to accomplish is

    1-Be able to set an image for each category
    2-Display Children categories of an category(IF HAS SOME) with this image.

    So if I have My main category —Cars
    ———————————–Exotic Cars

    Set an image for each category.
    So if I navigate to “Cars” I’ll see Mercedes, Honda & Exotic Cars with their thumbnails.

    Now If I navigate to Honda, there is no children category so I would like to display any categories in Cars if Possible.

    Thank you for help

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz


    There’s a number of approaches. Regardless, the template needs to be modified to insert an image into the usual category link. The question is, where to store the relationship between category and image?

    You could even create a new table, but it could also be done as a taxonomy. One other thought I had was to use the description field of the category, assuming your theme doesn’t use it. Then you don’t need any special code to manage the relationship, just paste the image url into existing the description field.

    Or you could simply name your images after the category, so that your template code can easily construct an image url.



Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add an image to category’ is closed to new replies.