Go through each category with for each loop
-
Hi. I’m designing a theme for wordpress. I know very well HTML/CSS, but as for PHP, I’m fairly new (however I’ve done programming, so I know the jargon).
I created a category from the dashboard, “products”. A couple of other categories are children of “products”. All the children of “products” have their own subcategories.
What I want to do in my theme is to pick up a direct child category of “products” and display it in an <h3> tag, and its children in an html list (for this I can use the template tag wp_list_categories). Then pick up the next direct child category of “products” and show it with her children, and so forth.
I guess it would be fairly easy to do with a for each loop, but again; I’m new to PHP so I’ve no idea about how to make it.
Thank you for your precious help (And very very soon you bet I’ll study PHP, I promise ?? !)
- The topic ‘Go through each category with for each loop’ is closed to new replies.