
This plugin provides the PHP function c2c_array_partition() to split an array into any number of sub-arrays, suitable for creating evenly distributed, vertically filled “columns”. Also known as “chunking” or “partitioning”.
For example:
$topics = array( "aardvark", "bear", "cat", "dog", "emu", "fox", "gnu", "hippo", "ibis", "jackal" ); print_r( c2c_array_partition( $topics, 4 ) );
Yields:
Array ( [0] => Array ( [0] => ant [1] => bear [2] => cat ) [1] => Array ( [0] => dog [1] => emu [2] => fox ) [2] => Array ( [0] => gnu [1] => hippo ) [3] => Array ( [0] => ibis [1] => jackal ) )
Note the array elements are distributed into the requested 4 “columns” as evenly as possible.
The function will fill as many partitions as requested, as long as there are enough elements in the array to do so. Any remaining unfilled partitions will be represented as empty arrays.
In contrast, using PHP’s built-in array_chunk() as such:
print_r( array_chunk( $topics, 4 ) );
Yields:
Array ( [0] => Array ( [0] => aardvark [1] => bear [2] => cat [3] => dog ) [1] => Array ( [0] => emu [1] => fox [2] => gnu [3] => hippo ) [2] => Array ( [0] => ibis [1] => jackal ) )
It can be sent an array of any data types or objects.
Links: Plugin Homepage | Plugin Directory Page | GitHub | Author Homepage
<?php $topics = array( "ant", "bear", "cat" ); print_r( c2c_array_partition( $topics, 5 ) ); ?>
=>
Array ( [0] => Array ( [0] => ant ) [1] => Array ( [0] => bear ) [2] => Array ( [0] => cat ) [3] => Array ( ) [4] => Array ( ) )
Also see Description section for another example. Definitely check out the packaged unit test file as it contains various examples.
Starting from $0 per month.
Rating
Reviewers
No reviews
Tags
Developed By
Scott Reilly
Quick & Easy
Common Ninja has a large selection of powerful Wordpress plugins that are easy to use, fully customizable, mobile-friendly and rich with features — so be sure to check them out!
Testimonial plugins for Wordpress
Contact Form plugins for Wordpress
Maps plugins for Wordpress
Translation plugins for Wordpress
Chat plugins for Wordpress
Slider plugins for Wordpress
Reviews plugins for Wordpress
Contact plugins for Wordpress
Galleries plugins for Wordpress
SEO plugins for Wordpress
Forms plugins for Wordpress
Comments plugins for Wordpress
Backup plugins for Wordpress
Privacy plugins for Wordpress
Optimize plugins for Wordpress
Tabs plugins for Wordpress
Social Sharing plugins for Wordpress
Events Calendar plugins for Wordpress
Comments plugins for Wordpress
Social Feeds plugins for Wordpress
Social Sharing plugins for Wordpress
Portfolio plugins for Wordpress
Video Player plugins for Wordpress
popup plugins for Wordpress
SiteMap plugins for Wordpress
Payment plugins for Wordpress
Coming Soon plugins for Wordpress
Inventory plugins for Wordpress
Testimonials plugins for Wordpress
Portfolio plugins for Wordpress
Membership plugins for Wordpress
Forms plugins for Wordpress
Analytics plugins for Wordpress
Events Calendar plugins for Wordpress
Sliders plugins for Wordpress
Analytics plugins for Wordpress
Reviews plugins for Wordpress
Security plugins for Wordpress
Ads plugins for Wordpress
Music Player plugins for Wordpress
Countdown plugins for Wordpress
Email Marketing plugins for Wordpress
Membership plugins for Wordpress
Ecommerce plugins for Wordpress
Customer Support plugins for Wordpress
Video Player plugins for Wordpress
Tabs plugins for Wordpress
Social Feeds plugins for Wordpress
Common Ninja Apps
Browse our extensive collection of compatible plugins, and easily embed them on any website, blog, online store, e-commerce platform, or site builder.
Create interactive infographics with a ratio widget that uses custom icons, dynamic tooltips, and clear visuals to help visitors understand data quickly.
Collect and manage donations securely with a customizable online donation form that supports Stripe or PayPal and helps increase contributions.
Add a no-code music player to your site to stream audio, share playlists, and support multiple formats with easy setup.

Show WordPress posts with a WordPress feed that keeps content fresh, improves navigation, and helps visitors discover more of your site.
Create business listings with a listings widget that presents companies clearly, supports easy organization, and helps visitors find the right services quickly.
Use a countdown to download widget that reveals files after the timer ends, builds anticipation, and guides visitors toward higher engagement.

Show Tumblr posts with a Tumblr feed that keeps content fresh, improves navigation, and helps visitors discover more posts.
Add a countdown timer to your site to highlight upcoming events or launches and encourage timely user action.
Add collapsible content sections to your site to organize information and help users navigate content more efficiently.
Show social proof that displays real user activity to build trust instantly, boost credibility, and help increase conversions across your site.
Transform PDFs into interactive flipbooks with a PDF flipbook widget that improves reading and keeps visitors engaged.
Detect ad blockers on your site to maintain visibility into user behavior and support sustainable ad-based monetization.
More plugins
The Common Ninja Search Engine platform helps website builders find the best site widgets, apps, plugins, tools, add-ons, and extensions! Compatible with all major website building platforms - big or small - and updated regularly, our Search Engine tool provides you with the business tools your site needs!
