Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    i understand you want to have a different color on the [adverts_list] as in the previous question? If so then modify the code from the previous thread to look like this

    
    add_filter( "adverts_css_classes", "my_adverts_css_classes", 10, 2);
    function my_adverts_css_classes( $classes, $post_id ) {
        $pid = get_post_meta( $post_id, 'payments_listing_type', true );
        if( $pid ) {
            $classes .= " product-color-id-" . $pid;
        }
        return $classes;
    }
    

    and in Additional CSS panel add

    
    .product-color-id-1000 {
      background-color: red !important;
      border-color: red !important;
    }
    

    This will change background to red assuming one of the WC products users can purchase via [adverts_add] has an ID = 1000.

    Thread Starter psykt

    (@psykt)

    Thanks a lot! Greg
    Happened :))

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘woocommerce plugin’ is closed to new replies.