0

I have tried to add content in the custom description tag using a code in the functions php as seen below. I want to add a background color to this section, but the background color stays white (default).

I am using this code;

add_filter( 'the_content', 'wpglorify_custom_description_tab' );

function wpglorify_custom_description_tab( $content ){

    if( is_product() ) { 
        $content .= '<p>[vc_section][vc_row full_width="stretch_row" equal_height="yes" content_placement="middle" fullwidth="1" css=".vc_custom_1648468332011{background-color: #f5f5f5 !important;}"][vc_column width="1/2" css=".vc_custom_1648468400351{margin-top: 50px !important;margin-bottom: 50px !important;}"][vc_column_text]

//content//

\[/vc_column_text\]\[/vc_column\]\[vc_column width="1/2" css=".vc_custom_1648468405860{margin-top: 50px !important;margin-bottom: 50px !important;}"\]\[vc_single_image image="3347" img_size="full" alignment="center"\]\[/vc_column\]\[/vc_row\]\[/vc_section\]</p>

';
}

return $content;

Can someone tell me what i am doing wrong?

7uc1f3r
  • 25,125
  • 15
  • 25
  • 45
T W
  • 1
  • **1)** `[vc_section]` is by default not recognized in WooCommerce, However, you do not mention anywhere in your question why you use this... **2)** [Inline CSS](https://stackoverflow.com/questions/2612483/whats-so-bad-about-in-line-css) should be avoided at all costs, why not just apply CSS the right way? – 7uc1f3r Mar 28 '22 at 13:31

0 Answers0