WordPress.org

Ready to get started?Download WordPress

Forums

wp_list_categories() template tags (4 posts)

  1. crimson0emperor
    Member
    Posted 7 years ago #

    I am outputting a list of categories using wp_list_categories. I want to be able to insert text in-between the category names (like commas), show the number of posts per category, and to edit the title from "Category" into "Posts filed under".

    I searched in the category.php (in wp-includes) template looking for output text strings or something the like and was unable to find a solution to the problem.

    I got this to work for showing the number of posts:

    <?php wp_list_categories('show_count=' . __ ('1')); ?>

    But when I try to edit the title as well as declare a post count, it doesn't work. This is my current code:

    <?php wp_list_categories('title_li=' . __('0')), 'show_count=' . __('1'); ?>

    And as far as inserting text in-between categories or commas, I'm totally at a loss.

    Any help would be greatly appreciated. Thanks!

  2. crimson0emperor
    Member
    Posted 7 years ago #

    Does anybody have any helpful information on this? It would be appreciated.

  3. moshu
    Member
    Posted 7 years ago #

    ON the page you linked to in the Codex there are at least 3 examples about the showcount:
    show_count=1

    <?php
    wp_list_categories('style=none&show_count=1&title_li=' . __('Posts filed under:') . '' ); ?>

    The style=none portion will remove the li tags = it will NOT be a list anymore, and WP will insert br tags - see the Codex. If you don't like it, remove the style=none& portion.

    I don't know how to insert commas...

  4. crimson0emperor
    Member
    Posted 7 years ago #

    Ahh, OK. So I think I'm separating my template tags incorrectly. I am not the most experienced in PHP.

    I'm trying to separate with commas. Am I to do it with ampersands?

Topic Closed

This topic has been closed to new replies.

About this Topic