WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
Hiding image on specific product pages (10 posts)

  1. mandalouz
    Member
    Posted 1 year ago #

    I'm trying to hide images on specific product pages.

    What I'm doing is showing the allergens for each food item. Not all food items have the same allergens, so I want to be able to hide that image. I've inserted the image in the backend with a class name, but I'm unable to hide it using the body class.

    Here's a link to the site: http://happybellybox.com/product/austin-raw-treats-pecal-praline/

    I want to be able to hide the yellow "DF" under the product image. HELP!

    http://wordpress.org/extend/plugins/woocommerce/

  2. IgniteWoo
    Member
    Posted 1 year ago #

    Try CSS like this:

    body.postid-543 .dairyfree { display: none; }

    Where 543 is the product ID number.

  3. mandalouz
    Member
    Posted 1 year ago #

    I tried that and it's still not hiding it.

  4. IgniteWoo
    Member
    Posted 1 year ago #

    Try this:

    body.postid-543 .dairyfree { display: none !important; }

  5. mandalouz
    Member
    Posted 1 year ago #

    Still not working. Ugh. I need to find a way to display these allergens on specific posts.

  6. IgniteWoo
    Member
    Posted 1 year ago #

    What puts that DF image into your pages?

  7. mandalouz
    Member
    Posted 1 year ago #

    I put the image into the content single product page template and applied the class so I could display it to "none" on certain pages.

  8. IgniteWoo
    Member
    Posted 1 year ago #

    You have a parse error in your CSS :-)

    Open style.css and go to line 33. You see this:

    #content .quantity input.qty {margin:0 !important;}

    }

    Remove that } character.

  9. mandalouz
    Member
    Posted 1 year ago #

    Oh my gosh! Thank you!!!!!!!!!!!!!!!!! It worked!!!! :D

  10. IgniteWoo
    Member
    Posted 1 year ago #

    No problem. Nice tats. I wouldn't get one but looks Ok on you. Happy to help a fellow Texan ya'll ;-)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic