WordPress.org

Ready to get started?Download WordPress

Forums

wp_list_categories vs wp_list_pages (2 posts)

  1. mreider
    Member
    Posted 5 years ago #

    Hi all,

    Quick question. In a current theme I have the following code to list the pages:
    <?php wp_list_pages('title_li=&depth=1&link_before=<span class="left-c">&link_after=</span><span class="right-c"> </span>'); ?>

    I'd like to do the same for categories, so I've changed the above to this:
    <?php wp_list_categories('title_li=&depth=1&link_before=<span class="left-c">&link_after=</span><span class="right-c"> </span>'); ?>

    This gets me the list of categories, but the styling is all messed up - the <span> tags that I have in that line of code do not appear.

    How can I make this work?

    Thanks for any help!

  2. Edward Caissie
    Theme Review Admin
    Posted 5 years ago #

    The wp_list_categories() function does not have the same parameters as the wp_list_pages() function ... its a good idea but not as straight forward as you were looking at. Here are the codex links for each function, maybe you will find a different idea to try.

    http://codex.wordpress.org/Template_Tags/wp_list_pages

    http://codex.wordpress.org/Template_Tags/wp_list_categories

Topic Closed

This topic has been closed to new replies.

About this Topic