iterate_categories_and_print_its_links.php

<?php $args = array( 'type' => 'post', 'child_of' => 0, 'parent' => '', 'orderby' => 'ID', 'order' => 'ASC', 'hide_empty' => 0, 'taxonomy' => 'category', 'exclude' => 1); $categories = get_categories($args); foreach($categories as $category){ $item = '<a href="'; $item .= get_bloginfo('url'); $item .= '/category/'; $item .= $category->slug; $item .= '">'; $item .= $category->name; $item .= '</a><br />'; echo $item; } ?>
Iterate all categories and prints its links.

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.