WordPress.org

Ready to get started?Download WordPress

Forums

How to re-arrange the categories in the nav bar? (15 posts)

  1. Tee
    Member
    Posted 4 years ago #

    Hey Folks.

    Here's my site: http://www.adidas-talk.com

    Now, notice the menu bar?

    -Home
    -News
    -Photos
    -Videos
    -Archives
    -Sneakers and so on.

    How can i organize my nav bar by whatever topic that I feel is more important for my readers?

    In the admin there isn't such an option :(

    http://img40.imageshack.us/img40/9461/picture3crl.png

  2. iridiax
    Member
    Posted 4 years ago #

    In your theme file with this code (probably header.php), change the orderby parameter in wp_list_categories to something else:

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

    If none of these orderby options work for you, you can always code in the category link list yourself.

  3. Tee
    Member
    Posted 4 years ago #

    Hey Iridiax

    Thanks for the reply.

    Here's all that i have in the header.php that relates to the categories. So Im kinda lost.. ?

    <ul id="menu">
    	<li<?php if(!is_category() && !is_page() && !is_single()) { ?> class="current-cat"<?php } ?>><a href="<?php bloginfo('url'); ?>" title="Home"><?php print HOME; ?></a></li>
    	<?php wp_list_categories('orderby=ID&order=ASC&depth=1&hide_empty=0&title_li='); ?>
    </ul>
  4. Tee
    Member
    Posted 4 years ago #

    Oh and one other random question.

    http://img40.imageshack.us/img40/9461/picture3crl.png <-- look at the category "NEWS" that used to be called "uncategorized" - how come I can't delete it, is it because that's a category by default when installing WP (uncategorized) ?

  5. insuperblog
    Member
    Posted 4 years ago #

    I also want to know this.
    My header.php has this

    <div class="HeaderMenu" id="HeaderMenu">
      <ul>
    		<li><a href="<?php echo get_option('home'); ?>">Home</a></li>
      	<?php
    		if ($aOptions['menu_dropdown'])
    			wp_list_categories('sort_column=name&title_li=&depth=3');
    		else
    			wp_list_categories('sort_column=name&title_li=&depth=1');
    		?>
    	</ul>
    </div>

    How to re-order them ? Must I create a categories first then only can reorder them ?

  6. insuperblog
    Member
    Posted 4 years ago #

    Update:
    Just tried the above header.php inside. I add another line below the HOME button
    <li><a href="<?php echo get_option('home'); ?>">Home2</a></li>
    so, if my categories name is "RELATED WEBSITES NEWS", what's suppose to replace the get_option('home'); ?

  7. iridiax
    Member
    Posted 4 years ago #

    In your first code snippet, replace this:

    wp_list_categories('orderby=ID

    with this

    wp_list_categories('orderby=name

    You can't delete the default category (ID 1), but you can rename it.

    The <li><a href="<?php echo get_option('home'); ?>">Home2</a></li> is to show a link to your home page. You can get rid of it if you don't want a link to your home page in the menu bar.

  8. insuperblog
    Member
    Posted 4 years ago #

    iridiax,
    I want keep the Home Page in menu bar.
    <li><a href="<?php echo get_option('home'); ?>">Home2</a></li>
    The preceeding code is I tried to copy & paste into another line below a php & see whether it works or not. Let say I got a Categories named "RELATED WEBSITES NEWS", how do I modified the above code to point into this Categories named "RELATED WEBSITES NEWS" ?

    If really can point into this Categories, does that mean whenever I create a new Categories, I also need to come back to this header.php file to do editing ?

  9. Tee
    Member
    Posted 4 years ago #

    Alright...

    So here's the code

    <?php wp_list_categories('orderby=ID<strong>&order=ASC&depth=1&hide_empty=0&title_li=</strong>'); ?>

    do I delete what I highlighted in bold? If I were to arrange the categories, how would i do so given the fact that the links are not numeric but alphabitical

    ex:
    -Home
    -News
    -Photos
    -Videos
    -Archives
    -Sneakers and so on.

    ex: http://adidas-talk.com/category/photos <--- and not
    http://adidas-talk.com/pd_id=2? or something like that

  10. iridiax
    Member
    Posted 4 years ago #

    do I delete what I highlighted in bold?

    No, replace this:

    <ul id="menu">
    	<li<?php if(!is_category() && !is_page() && !is_single()) { ?> class="current-cat"<?php } ?>><a href="<?php bloginfo('url'); ?>" title="Home"><?php print HOME; ?></a></li>
    	<?php wp_list_categories('orderby=ID&order=ASC&depth=1&hide_empty=0&title_li='); ?>
    </ul>

    With this:

    <ul id="menu">
    	<li<?php if(!is_category() && !is_page() && !is_single()) { ?> class="current-cat"<?php } ?>><a href="<?php bloginfo('url'); ?>" title="Home"><?php print HOME; ?></a></li>
    	<?php wp_list_categories('orderby=name&order=ASC&depth=1&hide_empty=0&title_li='); ?>
    </ul>
  11. Tee
    Member
    Posted 4 years ago #

    Hi Iridiax,

    Thanks for the help!

    I did what you suggested and it did re-arrange the menu only in alphabetical order... I was hoping I could define the position of the categories? Is that possible?

  12. Tee
    Member
    Posted 4 years ago #

    Sorry for the bump :( can anyone please give me a hand with this?

    I would like to re-arrange the nav bar in my prefered order...

    Thanks.

  13. insuperblog
    Member
    Posted 4 years ago #

    Now the wordpress still inability to re-arrange the categories in realtime in the dashboard.
    It can arrange by; ID, name, slug, count, term_group
    Example by the help of my Eos themes. These themes has the Options to let you choose how you want to arrange its categories. STILL! No custom re-arrangement.

    WordPress cannot let you simply arrange it Up a Level by clicking a simple icon in dashboard. Joomla CMS can do this, but not in WordPress (yet).

    I got a suggestions, but I'm not sure it works okay for u or not;
    (Option 1)
    - Plan ahead what kind of categories going to create in your blog.
    - Create the categories 1 by 1 in sequence by ur requirements.
    - Choose Sort by ID

    (Option 2)
    - Dig into MySQL Database for ur wordpress, find the existing categories ID & change these ID according by ur requirements.
    - Choose Sort by ID
    For options 2, I'm sure sure it will affects your other links that linking to that categories or not. If yes, u need to change all the Links to the new categories IDs.

    If someone know how to do a more easily methods than this. Please post up. Thanks.

    setup.insuperblog.com

  14. neosin09
    Member
    Posted 3 years ago #

    What if i have cats with month names and wanted it in order of the months?

    Order by name puts like April first, etc. How could i sort it by order of months?

  15. Aldo
    Member
    Posted 3 years ago #

    there is a wp plugin called: ┬┤category order┬┤. installing this gives you a simple menu which enables you to drag n drop your categories in the desired order. works super!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags