WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] list_cats issue...planning on skinning the cats alive in a second (11 posts)

  1. orange2apple
    Member
    Posted 6 years ago #

    Yet another issue I am sure requires only a simply fix. ATTEMPTING to exclude some categories from appearing in the sidebar. Used a plug-in that did nothing but remove the excluded category posts from the main section. And then did the following:

    <ul>
    <?php
    wp_list_categories('orderby=name&show_count=1&exclude=11, 12, 13, 14, 15'); ?>
    </ul>

    In the sidebar.php. It did nothing

    Then did:

    <div id="category"> <li class="sidebar-spacer"></li>
    <li><h2><?php _e('Categories'); ?></h2>
    <ul><?php list_cats(0, '', 'name', 'asc', '', 1, 0, 1, 1, 1, 1, 0,'','','orderby=name&show_count=1&exclude=11, 12, 13, 14, 15','','') ?></ul>
    </li>
    </div>

    In sidebar.php. Did nothing.

    HELP?

    Fadi

  2. Cal
    Member
    Posted 6 years ago #

    I think you had it right the first time, but probably remove the spaces, so it looks like this

    &exclude=8,9,7,19

  3. orange2apple
    Member
    Posted 6 years ago #

    Nope. That did not do it. Grrr... This makes no sense.

  4. moshu
    Member
    Posted 6 years ago #

    Is your theme using the sidebar widgets? In that case no editing has any effect: everything that is hardcoded in your sidebar is over-written by the widgets.

  5. Root
    Member
    Posted 6 years ago #

    You are editing the right file? And it is not a widget in the sidebar?

  6. orange2apple
    Member
    Posted 6 years ago #

    Ah...buggering hell...it is indeed a widget. All I need do is remove the widget?

  7. orange2apple
    Member
    Posted 6 years ago #

    I do have this in the sidebar.php:

    <div id="category"> <li class="sidebar-spacer">

  8. <h2><?php _e('Categories'); ?></h2>
      <?php wp_list_cats(0, '', 'name', 'asc', '', 1, 0, 1, 1, 1, 1, 0,'','','exclude=11,12,13,14,15','','') ?>
  9. </div>

    But if I remove the widget, nothing replaces the category info. The code above does nothing.

  • moshu
    Member
    Posted 6 years ago #

    You can't have both: either widgets or handcoded sidebar.
    You have to remove ALL the widgets to have the handcoded version displayed...

    Warning: if you do that, be aware that the template tag you are using is deprecated:
    http://codex.wordpress.org/Template_Tags/wp_list_cats

  • orange2apple
    Member
    Posted 6 years ago #

    Ah hell....and no way to configure that widget eh?

  • orange2apple
    Member
    Posted 6 years ago #

    Never mind...found a better widget..will just deal with the cats I don't want showing, showing.

  • Root
    Member
    Posted 6 years ago #

    You do not have to be clairvoyant to volunteer in this forum but it certainly helps............:)

  • Topic Closed

    This topic has been closed to new replies.

    About this Topic

    Tags