1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Wordpress question

Discussion in 'Blogging' started by treason, Mar 20, 2009.

  1. treason

    treason Junior Member

    Joined:
    Mar 4, 2009
    Messages:
    105
    Likes Received:
    138
    anyone know how to move categories to the top menu?
     
  2. spankythepyro

    spankythepyro Power Member

    Joined:
    Mar 7, 2009
    Messages:
    572
    Likes Received:
    94
    go to themes --> widgets and just click on it and you should get the compass rose like crosshair, you can then move it around.

    if it is not showing up int eh sidebar then create the sidebar on your own by adding it from the left side of that menu
     
    • Thanks Thanks x 1
  3. treason

    treason Junior Member

    Joined:
    Mar 4, 2009
    Messages:
    105
    Likes Received:
    138
    thanks for the help but I guess my question was ambiguous.

    what i meant was, the categories is currently placed on the right side of my site.

    I want to move it where the header is located that displays the top menu.
     
  4. saturday1

    saturday1 Power Member

    Joined:
    Dec 28, 2008
    Messages:
    564
    Likes Received:
    201
    Hehe change the themes^^

    like mine xgrey.com
     
  5. BlackMelvyn

    BlackMelvyn Regular Member

    Joined:
    Jul 8, 2008
    Messages:
    202
    Likes Received:
    272
    Home Page:
    Find the place in the header HTML code where you want to display your cats and then use this code
    Code:
    <?php wp_list_categories(); ?>
    that should do it :)
     
    • Thanks Thanks x 1
  6. treason

    treason Junior Member

    Joined:
    Mar 4, 2009
    Messages:
    105
    Likes Received:
    138
    thanks, but that didn't work.

    here's the original header.php code:

    thanks in advance!
     
  7. BlackMelvyn

    BlackMelvyn Regular Member

    Joined:
    Jul 8, 2008
    Messages:
    202
    Likes Received:
    272
    Home Page:
    At the bottom of your code snippet, replace
    Code:
    <?php wp_list_pages('title_li=&depth=1&'.$page_sort.'&'. $pages_to_exclude)?>
    by
    Code:
    <ul>
    <?php
    wp_list_categories('orderby=name&include=3,5,9,16'); ?> 
    </ul>
    In the above code snippet, change 3,5,9,16 by the IDs of the categories you want to display
     
    • Thanks Thanks x 1
  8. treason

    treason Junior Member

    Joined:
    Mar 4, 2009
    Messages:
    105
    Likes Received:
    138
    thanks for the help mate, but unfortunately, I still get the same result.
     
  9. 195471

    195471 Regular Member

    Joined:
    Oct 11, 2008
    Messages:
    417
    Likes Received:
    260
    Try this:

    Code:
    <div class="top-Menu" id="chromemenu">
    <ul>
    <li><a href="<?php echo get_option('home'); ?>/">Home</a></li>
    <?php wp_list_pages('title_li=&depth=1&'.$page_sort.'&'. $pages_to_exclude)?>
    </ul>
    <ul><?php wp_list_categories('title_li='); ?></ul>
    </div>
    
    As you can see, I just added the following line below the first unordered list in the chromemenu div:

    Code:
    <ul><?php wp_list_categories('title_li='); ?></ul>
    This will create a second unordered list for your categories, and they should be displayed horizontally like the pages. You must keep the ('title_li=') part because otherwise, it will add the word "Categories" to your menu.
     
    • Thanks Thanks x 1
  10. treason

    treason Junior Member

    Joined:
    Mar 4, 2009
    Messages:
    105
    Likes Received:
    138
    I still get the same result :(

    thanks for your help though.
     
  11. treason

    treason Junior Member

    Joined:
    Mar 4, 2009
    Messages:
    105
    Likes Received:
    138
    NEVERMIND, it works :D
    I just had to also edit the code on home.php.

    thanks!