Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm trying to make a layered wordpress menu, out of categories. Here's how it's going to look:

enter image description here

I have no clue how to develop this, can't do it with get_posts (not sortable by parent/children), or wp_list_categories (can't pull thumbnails). Also, I have to assign thumbnails to categories somehow.

Is there an easy way to implement something like this with wordpress?

share|improve this question

migrated from stackoverflow.com Aug 22 '11 at 7:57

This question came from our site for professional and enthusiast programmers.

3 Answers 3

up vote 1 down vote accepted

although @roikles offers a way to do it, I don't think it is very flexible as you will have to go back in the code when you want to add a new category.

Another way of doing it can be to add the image of the subcategory as the description of the subcategory. To be able to do so, you will first need to allow XHTML in category descriptions. Add this line to your functions.php:

remove_filter( 'pre_term_description', 'wp_filter_kses' );

Then you can echo that description with wp_list_categories

share|improve this answer

You could create your menu in wp-admin>appearance>menus then make sure that custom CSS classes is checked in the Screen options drop down at the top of wp-admin.

All you would need to do then is give each menu item a css class and within your stylesheet define the menu image as a background image.

share|improve this answer

I'd look at using the custom Walker menu (outlined here). That way you can control what the output is and add dynamic CSS using the category slug. afterwards, you just output that specific menu in the location you want it.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.