Exception in function.php
-
Hi.
i have this code in my function.php:
add_filter( 'sidebars_widgets', function( $sidebars_widgets ) { $sidebar_index = 'sidebar-1'; if( isset( $sidebars_widgets[$sidebar_index] ) ) { shuffle( $sidebars_widgets[$sidebar_index] ); $sidebars_widgets[$sidebar_index] = array_slice( $sidebars_widgets[$sidebar_index], 0, 8 ); } return $sidebars_widgets; }, PHP_INT_MAX );
Working perfect. I see 8 randomly widgets in one widget area. Problem is a see 8 randomly widgets in my administration too. It is possible to make an exception in this code for admin area. I will see all widget there.
Thanks.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Exception in function.php’ is closed to new replies.