• Resolved etc_stream

    (@etc_stream)


    Hi everyone,

    I’ve been looking for a way to display my children categories independently form their parent. I found this code:

    <?php
    if (is_category()) {
    $this_category = get_category($cat);
    }
    ?>
    <?php
    if($this_category->category_parent)
    $this_category = wp_list_categories(‘orderby=id&show_count=0
    &title_li=&use_desc_for_title=1&child_of=’.$this_category->category_parent.
    “&echo=0”); else
    $this_category = wp_list_categories(‘orderby=id&depth=1&show_count=0
    &title_li=&use_desc_for_title=1&child_of=’.$this_category->cat_ID.
    “&echo=0”);
    if ($this_category) { ?>

      <?php echo $this_category; ?>

    <?php } ?>

    It perfectly works. But now, I’m turning crazy trying to display it the way I want. How do I have to proceed if I want this to be displayed horizontally without any “·” before the name of the category?

    I tried to add the same div than the one I use for the categories and colors or fonts style are applied but that’s all.

    Thanks for you patience and answers

Viewing 1 replies (of 1 total)
  • Thread Starter etc_stream

    (@etc_stream)

    Hi,

    I’ve been able to do it.

    For those who need to do the same. Here is the answer.

    I finally used this code specifying the id of the wished category

    <?php wp_list_cats(‘sort_column=id&optioncount=0&use_desc_for_title=0&list=1&child_of=2637’); ?>

    I then added a specific

      like this:

    <ul class=”nameityourself”><?php wp_list_cats(‘sort_column=id&optioncount=0&use_desc_for_title=0&list=1&child_of=2637’); ?>

    That’s all. Use the CSS to display it like you want

Viewing 1 replies (of 1 total)

The topic ‘CSS – Children Categories’ is closed to new replies.