Hello, I’m new here so hopefully I do nothing wrong when posting this (I’ve read the rules and searched already). I’m currently designing a wordpress template for my new site but i’m running it on localhost at the moment so I can’t link to it.
What I would like is on a certain template is to list the categories as a series of buttons using separate divs but after spending a long time searching I can’t seem to get my head around it (if its possibly to do at all).
Currently all I have is the basic code which just displays it as a list and separates them using the standard li tags.
<?php wp_list_categories('show_count=1&child_of=10&show_count=0&depth=1&title_li='); ?>
I’m not crazy so I do understand I’ve probably started the whole thing with the wrong tag (wp_list_categories), but I’m not sure of the correct alternative.
I’m wanting the end result to be like this
<div class="cat-button">CATEGORY 1</div> <div class="cat-button">CATEGORY 2</div> <div class="cat-button">CATEGORY 3</div>
Also where it says child_of=10 I would prefer to call by the category slug.
Any help or advice would be much appreciated.
Thanks in advance
- The topic ‘Turning Category Lists into separate divs’ is closed to new replies.