wp_list_categories link varbiale
-
Hi everyone!
I had some issues with wp_list_categories and now I’m using get_categories. All is well but I don’t know what should I put in my href=”” for it to be universal.
In wp_list_categories the categories are links by default – here they are text and I want the link to be universal (to work both when permalinks are display postname or ID – you know what I mean).
This is my code:
<?php
echo ‘<ul id=”main-categories-list”>’;
$cat = get_query_var(‘cat’);
foreach(get_categories(“orderby=name&order=ASC&child_of=”.$cat.”&hide_empty=0″) as $category) {
echo ‘- ‘.$category->cat_name.’
‘.$category->description.’ ‘.get_cat_icon(“echo=0&cat=”.$category->cat_ID).’
‘;
}
echo ”;
?>What should I put in my ?
Thanks for your help! - ‘.$category->cat_name.’
The topic ‘wp_list_categories link varbiale’ is closed to new replies.