WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] wp_list_cats not working (13 posts)

  1. zomzommarketing
    Member
    Posted 7 years ago #

    Hi,
    I am using a theme that is compatible to 2.0.1 with WordPress 2.1. Is this why any change I make to the wp_list_cats doesn't do a darn thing or is there some other problem I should be aware of?

    Even the simplest of changes like sort by name or id results in nothing but the default.

    If this is the reason then can someone kindly point me to a tutorial on upgrading the theme. My search results only point to upgrading the WordPress version.

    I thought I would post here before downgrading my install back to 2.0.1

    Thanks in advance.

  2. MichaelH
    Member
    Posted 7 years ago #

    Try the template tag, wp_list_categories, instead of wp_list_cats.

  3. zomzommarketing
    Member
    Posted 7 years ago #

    I have tried that before posting this but thanks for that quick reply. That's why I'm thinking I need to replace more elsewhere in the theme than just the one line.

  4. MichaelH
    Member
    Posted 7 years ago #

    So you say it (using wp_list_categories) doesn't do anything...

    Where are you placing the code, in your sidebar.php file?

    What theme are you using?

    Exactly what code are you using for wp_list_categories?

  5. zomzommarketing
    Member
    Posted 7 years ago #

    The code is in my sidebar.php file.

    It looks like this:
    <?php wp_list_categories('orderby=id&exclude=4'); ?>

    But it still orders by name and category 4 still is on display.

    (I made a home page with <?php get_header(); query_posts('category_name=home'); ?> in the header. home is category 4 and doesn't need to be in the list. The list is a portfolio of services.

    The theme is from TemplateMonster.

    It's odd that wp_list_pages is not in the header but rather in the index.php, page.php and now my home.php don't you think? This wouldn't cause it would it?

  6. Dgold
    Member
    Posted 7 years ago #

    I had some problems migrating from wp-list-cats to wp-list-categories as well, it could be a matter of writing the arguments (the options) correctly. I'm not saying yours is done wrong, I can't tell. It took me several tweaks to get it to work in my theme.

    "It's odd that wp_list_pages is not in the header but rather in the index.php, page.php and now my home.php don't you think? This wouldn't cause it would it?"

    I don't think that is odd, or a problem.

  7. MichaelH
    Member
    Posted 7 years ago #

    Can't understand why Category 4 would still be appearing unless Category 4 is not what you think it is or there's more that one template tag displaying categories.

    Please check the Category ID in Manage Categories.

    Try this:
    <?php wp_list_categories('orderby=ID&exclude=4'); ?>

  8. zomzommarketing
    Member
    Posted 7 years ago #

    Yup, Tried that with a cut and paste - no go.

    Tried this too:
    <?php wp_list_categories('orderby=ID&include=2,3,5,6,7,8,9'); ?>

    No change.

    Nothing in functions.php to change?

  9. moshu
    Member
    Posted 7 years ago #

    Is the widgets plugin active by any chance? in that case your editing will never show up in the sidebar.

  10. MichaelH
    Member
    Posted 7 years ago #

    Well if you are using widgets then changing sidebar.php may make no difference. You'd have to make the change to the widget code.

    [oops see moshu got there first]

  11. zomzommarketing
    Member
    Posted 7 years ago #

    Oh I am such a noob!

    OK, That's what's happening then.

    Where is that code located - I think I can handle it from here after pointing me in the right direction - thanks

    I love WordPress -

  12. MichaelH
    Member
    Posted 7 years ago #

    In 2.2 it is in wp-includes/widgets.php.

  13. zomzommarketing
    Member
    Posted 7 years ago #

    OK, let's resolve this now:

    in 2.1 widgets are still a plugin and found in the plugin folder. find widgets.php and look for this line of code
    <?php wp_list_cats...
    (mine was on line 919)
    Make the changes based on the http://codex.wordpress.org/Template_Tags/wp_list_cats instuctions. Mine looked like this when it was done:

    <?php wp_list_cats("sort_column=id&optioncount=$c&hierarchical=$h&exclude=1, 4"); ?>

    Thanks for letting me think out loud.

Topic Closed

This topic has been closed to new replies.

About this Topic