Limit widgets in widget area
-
Hi.
I will have about 100 widgets in one widgets area (RSS widgets).
I figure out how to display random widgets with this code:
add_filter( 'sidebars_widgets', function( $sidebars_widgets ) { $sidebar_index = 'sidebar-1'; if( isset( $sidebars_widgets[$sidebar_index] ) ) { shuffle( $sidebars_widgets[$sidebar_index] ); } return $sidebars_widgets; }, PHP_INT_MAX );
But I will not show them all 100 at once, just 8 of them. How can I hide other 92?
Thanks.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Limit widgets in widget area’ is closed to new replies.