Forums

Logic problem in categories displaying (12 posts)

  1. dmytron
    Member
    Posted 2 years ago #

    I found some problem with categories when it ordered hierarchically.
    It my sample http://vinoosuae.com/ categories "Brackish Aquarium", "Freshwater aquarium" and "Seawater Aquarium" is subcategories for parent categories "Aquarium", but visual shown inside categories "Fish" (which is equal to categories "Aquarium" in categories hierarchy),
    I use red margin and some shift to show it.

    Logically, it must more good look in the same way, but inside categories "aquarium"

    Problem is:

    if we have (for example) two categories with same level, and first of them have a subcategories, then second categories box will start not after the last subcategories of first categories box, but exactly after first categories box.

  2. dmytron
    Member
    Posted 2 years ago #

    wordpress 2.8.1
    categories code:

    <div class="sidebar-box">
    <h3>Categories</h3>
    <ul>
    <?php wp_list_cats('sort_column=name&hierarchical=1'); ?>
    </ul>
    </div>
  3. dmytron
    Member
    Posted 2 years ago #

    up

  4. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    Did you realise that if you bump posts, you actually reduce your chances of anyone responding?

    What version of WP are you using? wp_list_cats is deprecated in favour of wp_list_categories.

  5. dmytron
    Member
    Posted 2 years ago #

    Why? Answer for this post will help for many others.

    I use wp 2.8.1 - it shown in my post.

  6. dmytron
    Member
    Posted 2 years ago #

    if I use a wp_list_categories instead of wp_list_cats i get same result.
    As I said - this is WordPress logic bug.
    Because box for next equal in the rang categories start exactly after previously categories, and not check - we have or not have subcategories for previously categories.
    This is problem must be solve for all, not only for me.

  7. viceng
    Member
    Posted 2 years ago #

    you are missing a ul tag in front of your primary categories...it's there for the first but not for the ones after that.

  8. dmytron
    Member
    Posted 2 years ago #

    not - it is not missing and this is for all, not only for first.
    as I said - it is logical bag of WordPress

  9. dmytron
    Member
    Posted 2 years ago #

    please help

  10. viceng
    Member
    Posted 2 years ago #

    Here is what is being generated

    div class="sidebar-box"><!-- AVH Extended Categories version 2.0.3 | http://blog.avirtualhome.com/wordpress-plugins/ -->
    
    <h3>Categories</h3>
    
    <ul>	<li class="cat-item cat-item-18"><a>Aquariums</a>
    </li>
    <ul class='children'>
    	<li class="cat-item cat-item-20">Brackish aquarium
    </li>
    	<li class="cat-item cat-item-21">Freshwater aquarium
    </li>
    	<li class="cat-item cat-item-19">Seawater aquarium
    </li>
    </ul>
    </li><--------------should be a <ul>
    	<li class="cat-item cat-item-5"><a>Fish</a>
    </li>
    </ul>
    </div>

    the error is that the /li should be a ul

    I used your code in a test blog and it works correctly under 2.8.1

    Perhaps the problem is in your extended categories plugin

  11. dmytron
    Member
    Posted 2 years ago #

    Yes!Exactly! It should be!
    But - this problem is not a part of plugin or theme - it part of WordPress!
    Because it coming with any theme and any plugin.
    I can show it, if it is necessary.

  12. viceng
    Member
    Posted 2 years ago #

    the wierd thing about this is that I took your code and placed it on my 2.8.1 site and it worked fine.

    viceng.net

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.