Menaka S. on "[Theme: Customizr] remove sidebar in category pages"

ساخت وبلاگ

Hi everyone,

I'm not a programmer, I take hours searching for the net solution to this and I have not managed to find it :( Hopefully someone knows the solution.

I would like to remove the sidebar that appear in the categories pages.
A code could be put in the functions.php would be great, also by eliminating the sidebar content suits fill that space (fullwidth).

Thanks if anyone can help

(sorry for my english, is not very good)

pikatxu77
Member
Posted 14 hours ago #

Thanks Menaka for your support!

Unfortunately I do not understand which code I have to put to delete the sidebar from categories.

But it's my fault not understand programming :(

Thank you!

Menaka S.
Member
Posted 1 minute ago #

Hi,
Add this to you child theme's functions.php and modify to suit your needs.

add_filter('tc_global_layout', 'my_custom_layout' );
function my_custom_layout( $layout ) { $my_layout_for_categories = array( 'r' => array ('content' => 'span6' , 'sidebar' => 'span6'), 'l' => array ('content' => 'span6' , 'sidebar' => 'span6'), 'b' => array ('content' => 'span6' , 'sidebar' => 'span3'), 'f' => array ('content' => 'span12' , 'sidebar' => false), ); if ( is_category() ) { $my_layout = $my_layout_for_categories; } //sets new values for content and sidebar (checks if there are new values to set first) foreach ($layout as $key => $value) { $layout[$key]['content'] = isset( $my_layout[$key]['content']) ? $my_layout[$key]['content'] : $layout[$key]['content']; $layout[$key]['sidebar'] = isset( $my_layout[$key]['sidebar']) ? $my_layout[$key]['sidebar'] : $layout[$key]['sidebar']; } return $layout;
}

WordPress ...
ما را در سایت WordPress دنبال می کنید

برچسب : نویسنده : استخدام کار wpss بازدید : 441 تاريخ : سه شنبه 2 شهريور 1395 ساعت: 10:59