Editing a navigation bar's link order

Discussion in 'PHP' started by andysm849, Jul 15, 2008.

  1. #1
    Hi
    Im trying to edit the navigation bar of the site in my sig so that instead of displaying the links alphabetically it displays them how I want. Basically I just want the advertising page at the end, not the beginning. Anyways this is the code I got from header.php in my wordpress theme files. "Clearpixels" is the name of the theme. I assume that $page_sort has something to do with it sorting them alphabetically? Is there anyway I can rearrange these tabs, or would that require a crapload of php work?


    <div id="topmenu">
    <ul>
     <li<?php if ( is_home() or is_archive() or is_single() or is_paged() or is_search() or (function_exists('is_tag') and is_tag()) ) { echo ' class="current_page_item"'; } ?>><a href="<?php echo get_option('home'); ?>">Home</a></li>
               <?php
    global $page_sort;
    	if(get_option('Clearpixels_sortpages')!='')
    	{
    		$page_sort = 'sort_column='. get_option('Clearpixels_sortpages');
    	}
    	global $pages_to_exclude;
    
    	if(get_option('Clearpixels_excludepages')!='')
    	{
    		$pages_to_exclude = 'exclude='. get_option('Clearpixels_excludepages');
    	}
    wp_list_pages('title_li=&depth=1'.$page_sort.'&'.$pages_to_exclude); ?>
    </ul>
    
    </div>
    Code (markup):

     
    andysm849, Jul 15, 2008 IP
  2. thundercow

    thundercow Well-Known Member

    Messages:
    246
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    108
    #2
    uhh...which version of wordpress are you running? If you are running 2.5, there is a selection in the MANAGE > PAGES editing window way at the bottom marked "PAGE ORDER", you can put digits in there to force the pages into a certain order.
     
    thundercow, Jul 18, 2008 IP
  3. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yeah, and you will also have to change the sort order in the Design=>Clearpixels Options page to Page Order. You don't have to mess with the files at all.
     
    Cash Nebula, Jul 19, 2008 IP
  4. andysm849

    andysm849 Peon

    Messages:
    198
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Oh great thanks. I thought it was gonna be some big deal but I guess not. Thanks for the help.
     
    andysm849, Jul 20, 2008 IP