in the i created a page with all the category links i was wondering to limit the amount of links per page like for post how it controls number of post per page, also if anyone knows how to make links that make it show links that begin with A or B etc... that be helpful too.
<?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 />';
}
?>
I'm using this code to get the category list how woul i limit the amount shown per page?
I get a weird error when i place the code in, either it doesn't work or I don't know how to use it probably the ladder tho...
jrav001
Member
Posted 2 weeks ago #
theres a error line 84...
this is for limiting number categories per page on a category list page if the title doesn't convey the message well enough...