WordPress.org

Ready to get started?Download WordPress

Forums

[closed] How to separate category list into multiple pages (2 posts)

  1. gbaka
    Member
    Posted 4 years ago #

    it doesn't have to be a fancy pagination but i just want to be able to control the number of categories per page in a category list is there anyway to do this, or something similar to the way joomla does it with their categories?

    <?php
    $categories = get_categories();
    foreach ($categories as $cat) {
    	if ($cat->category_parent != 0) {
    		echo '<span style="padding-left:10px;">';
    	}
    	echo '<a href="'.get_option('home').get_option('category_base').'/'.$cat->category_nicename.'/">'.$cat->cat_name.'</a> ('.$cat->category_count.')';
    	if ($cat->category_description != '') {
    		echo ' - '.$cat->category_description;
    	}
    	if ($cat->category_parent != 0) {
    		echo '</span>';
    	}
    	echo '<br />';
    }
    ?>
  2. MichaelH
    Member
    Posted 4 years ago #

    Please don't post duplicate topics.

    Continue discussion here:
    http://wordpress.org/support/topic/330163?replies=6

Topic Closed

This topic has been closed to new replies.

About this Topic