How can I implement this function in a more efficient manner?

  • Unknown's avatar

    I have currently been adding category headers (i.e. bed and bath, pets, photograpgy and film, apple accessories, etc) to my individual products through using css, this is some of the code:

    li.product.product-cat-travelandoutdoors .product-inner:after {
    background: url(“http://thatseasier.com/wp-content/uploads/2014/04/tnokick-product-top366x45-e1398646916426.png”) no-repeat top left;
    display: block;
    content: ” “;
    width: 270px;
    height: 33px;
    position: absolute;
    top: 0;
    left: 0;
    }

    li.product.product-cat-entertainment .product-inner:after {
    background: url(“http://thatseasier.com/wp-content/uploads/2014/04/entkick-product-top366x45-e1398646224467.png”) no-repeat top left;
    display: block;
    content: ” “;
    width: 270px;
    height: 33px;
    position: absolute;
    top: 0;
    left: 0;
    }

    li.product.product-cat-electronics .product-inner:after {
    background: url(“http://thatseasier.com/wp-content/uploads/2014/04/eleckick-product-top366x451-e1398647452242.png”) no-repeat top left;
    display: block;
    content: ” “;
    width: 270px;
    height: 33px;
    position: absolute;
    top: 0;
    left: 0;
    }

    li.product.product-cat-healthandfitness .product-inner:after {
    background: url(“http://thatseasier.com/wp-content/uploads/2014/04/hnfkick-top-product366x45-e1398647401862.png”) no-repeat top left;
    display: block;
    content: ” “;
    width: 270px;
    height: 33px;
    position: absolute;
    top: 0;
    left: 0;
    }

    I would also like to assign these product headers based on “if” functions.

    So lets say if the category falls into two categories like “red” electronics and “green” electronics that the appropriate header can be assigned accordingly.

    I just am assuming there’s a cleaner way of doing this then writing out 200 lines of css, which im also assuming slows down my website load time.

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar
    thistimethisspace · Member ·

    We provide support only for blogs being hosted WordPress.COM and not for WordPress.ORG software installs. You are posting to the wrong support forum. If you don’t have a username account at WordPress.ORG click http://wordpress.org/support/ and register one on the top right hand corner of the page that opens, so you can post to the support forums there and receive advice from WordPress.ORG bloggers.

  • The topic ‘How can I implement this function in a more efficient manner?’ is closed to new replies.