Use when looping category elements within 'get_all_category_ids'
-
Great plugin, exactly what I needed! However, I’ve got it working in archive.php, but can’t get it working in a page. I’m quite new to php so I’m sure the solution is simple, but I’ve wasted enough time trying to work it out, so any help would be greatly appreciated!
I want to loop out the link, title and icon for each category. I’ve got the link and title working, but nothing I try outputs the icon. Here’s my code:
<?php $category_ids = get_all_category_ids(); $args = array( 'orderby' => 'slug', 'parent' => 0 ); $categories = get_categories( $args ); foreach ( $categories as $category ) { echo '<a href="' . get_category_link( $category->term_id ) . '"><div><div>'; <strong>* I want to output the icon here *</strong> echo '<h3>' . $category->name . '</h3></div></div></a>'; } ?>
Many thanks, Wil
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Use when looping category elements within 'get_all_category_ids'’ is closed to new replies.