Forums

[resolved] Edit child <li>s in wp_list_categories() (4 posts)

  1. marcy_sss
    Member
    Posted 2 years ago #

    Greetings!

    I can't seem to figure out why wp_list_categories() will not show changes to the child <li>s. I want to manually add &raquo after the opening <li> and before the link, so that my list styles are supported in Internet Explorer. Like this:

    <li class="cat-item">&raquo; <a href="link" rel="bookmark" title="article">Article Title</a></li>

    It works everywhere in my sidebar except in wp_list_categories(), which I am editing in category_template.php. I tried adding it wherever there is an <li> in the code, but nothing shows up as output. It does show up when I add it to the <li> with the Title ("Categories") so it seems like it should work.

    $output .= '<li class="cat-item">&raquo; <a href="' . get_bloginfo( 'url' ) . '">' . $show_option_all . '</a></li>';

    Am I missing something? Here is a link to my blog:

    http://www.suttonrv.com/test/blog/

    Thank you very much!

  2. marcy_sss
    Member
    Posted 2 years ago #

    bump!

  3. marcy_sss
    Member
    Posted 2 years ago #

    Eventually found an answer and posted my results here:


    http://wordpress.org/support/topic/303103?replies=6

  4. khaleelm
    Member
    Posted 2 years ago #

    I tried finding it everywhere too and did the replacements.

    Thanks. I edited your snippet..


    <?php
    $categories = get_categories();
    foreach ($categories as $cat)
    {
    ?>
    <li class="cat-item">» cat_ID ); ?>"><?= $cat->cat_name; ?> <?= '('.$cat->category_count.')' ?>
    <?php
    }
    ?>

    The following displays the links like:

  5. » Category 1 (34)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags