No Sidebar on Single Product
-
I have the Divi theme.
To get the sidebar to display on brands I inserted the code:function my_et_divi_output_content_wrapper_end() {
echo ‘</div> <!– #left-area –>’;
$queried_object = get_queried_object();
if(is_a($queried_object,’WP_Term’) && $queried_object->taxonomy == ‘pwb-brand’){
get_sidebar();
}
echo ‘
</div> <!– #content-area –>
</div> <!– .container –>
</div> <!– #main-content –>’;}
function my_et_woocommerce_custom_sidebar() {
remove_action( ‘woocommerce_after_main_content’, ‘et_divi_output_content_wrapper_end’, 10 );
add_action( ‘woocommerce_after_main_content’, ‘my_et_divi_output_content_wrapper_end’, 10 );
}
add_action( ‘after_setup_theme’, ‘my_et_woocommerce_custom_sidebar’, 50 );However, this turns off the sidebar on the single product pages.
The sidebar displays on brands and category pages.The page I need help with: [log in to see the link]
- The topic ‘No Sidebar on Single Product’ is closed to new replies.