Home Forums Front-end Issues Woocommerce Category Feature Image


Woocommerce Category Feature Image

    • winkweb

    • November 22, 2019 at 10:24 am

    I’m wanting to display a feature image for each Woocommerce category. I’ve got the image upload showing up for the category, and the URL of the image being returned as a background on the code, but the image itself does not show.

    Code is as follows:
    <div id=”category-feature-image”>
    // get the current taxonomy term
    $term = get_queried_object();
    // vars
    $image = get_field(‘category-feature-image’, $term);
    <style type=”text/css”>
    background-image: url(<?php echo $image[‘url’]; ?>);
    height: 400px;

    The code returned on the site is below:

    <div id=”category-feature-image” style=”height:400px;”>
    <style type=”text/css”>
    background-image: url(;
    height: 400px;

    Any ideas why it is generating the url for the image (and changes depending on the category I’m viewing), but not actually displaying it.


Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.