• Resolved perryg

    (@perryg)


    I am using WordPress to make a complete site and am making pages and using them as the tabs across the top of the page eg; home ,about etc. my question is can you control the order these are displayed.an example would be i currently have home,about,contact,blog and want to change it to home,blog,about,contact.Is this possible and how would one do this, any help is appreciated .
    perry

Viewing 6 replies - 1 through 6 (of 6 total)
  • stvwlf

    (@stvwlf)

    Yes you can. On the Page edit/create page, and also in QuickEdit there is a field called Page Number. They tabs will be ordered in page number order. So number the pages in the order you want them to display. You can also change your mind later and change the order.

    Thread Starter perryg

    (@perryg)

    Is this the attributes area where it say’s (main page)no parent and then below that there is a box for order. If this is the case I have ordered them 1,2,3 and no change.If this is not the one you are talking about I can’t seem to locate it, I am using version 2.7.Is there something I am missing. Thank you for your time and rapid response it is very appreciated.

    Technokinetics

    (@technokinetics)

    Check the code generating the menu (probably in your header.php theme file). It needs to be something like this: wp_list_pages('title_li=&depth=1&sort_column=menu_order'). The sort column parameter here tells WP to sort the Pages by page order rather than alphabetically, which is the default.

    – Tim

    Thread Starter perryg

    (@perryg)

    There doesn’t appear to be any code like that, i have attached the header php file maybe someone could please identify what needs to be changed to sort this out.I am no coder so a bit out of my league.

    <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”&gt;
    <html xmlns=”https://www.w3.org/1999/xhtml”&gt;

    <head>
    <link rel=”shortcut icon” href=”https://www.forextofreedom.com/favicon.ico”/&gt;
    <link rel=”icon” href=”https://www.forextofreedom.com/favicon.ico”/&gt;
    <link rel=”shortcut icon” href=”<?php bloginfo(‘template_directory’); ?>/favicon.ico” />
    <meta name=”verify-v1″ content=”cOLmEhbOc0b5fmyCNEK+dgg6mz3c6MY0+HSx+djYvFA=” />
    <meta http-equiv=”Content-Type” content=”<?php bloginfo(‘html_type’); ?>; charset=<?php bloginfo(‘charset’); ?>” />
    <title><?php if (is_home () ) { bloginfo(‘name’); }
    elseif ( is_category() ) { single_cat_title(); echo ‘ – ‘ ; bloginfo(‘name’); }
    elseif (is_single() ) { single_post_title();}
    elseif (is_page() ) { single_post_title();}
    else { wp_title(‘’,true); } ?></title>
    <meta name=”robots” content=”index,follow” />
    <meta name=”generator” content=”WordPress <?php bloginfo(‘version’); ?>” />
    <link rel=”stylesheet” href=”<?php bloginfo(‘stylesheet_url’); ?>” type=”text/css” media=”screen” />
    <link rel=”alternate” type=”application/rss+xml” title=”<?php bloginfo(‘name’); ?> RSS Feed” href=”<?php bloginfo(‘rss2_url’); ?>” />
    <link rel=”pingback” href=”<?php bloginfo(‘pingback_url’); ?>” />

    <?php wp_head(); ?>

    </head>

    <body>
    <div id=”wrapper”>

    <div id=”header”>
    <div class=”topright”>
    <?php include (TEMPLATEPATH . ‘/searchform.php’); ?>
    </div>
    </div> <!– Closes Header –>

    <div class=”cleared”></div>
    <div id=”underheader”>
    <div id=”toprss”>“>
    <img src=”<?php bloginfo(‘template_directory’); ?>/images/grabrss.gif” alt=”grab our rss feed”></img>

    </div>

    <h1 class=”sitename”>“><?php bloginfo(‘name’); ?></h1>
    <h2 class=”sitedesc”><?php bloginfo(‘description’); ?></h2>

    </div><!– Closes underHeader –>

    <div id=”nav”>
    <?php function get_the_pa_ges() {
    global $wpdb;
    if ( ! $these_pages = wp_cache_get(‘these_pages’, ‘pages’) ) {
    $these_pages = $wpdb->get_results(‘select ID, post_title from ‘. $wpdb->posts .’ where post_status = “publish” and post_type = “page” order by ID’);

    }
    return $these_pages;
    }

    function list_all_pages(){

    $all_pages = get_the_pa_ges ();
    foreach ($all_pages as $thats_all){
    $the_page_id = $thats_all->ID;

    if (is_page($the_page_id)) {
    $addclass = ‘ class=”current_page”‘;
    } else {
    $addclass = ”;
    }
    $output .= ‘<li’ . $addclass . ‘>ID).'” title=”‘.$thats_all->post_title.'”><span>’.$thats_all->post_title.'</span>‘;
    }

    return $output;
    }
    ?>

      <?php

      if (is_home()) {
      $addclass = ‘ class=”current_page”‘;
      } else {
      $addclass = ”;
      }
      echo “<li” . $addclass . “><span>Home</span>“;
      echo list_all_pages();?>

    <div class=”cleared”></div>
    </div> <!– Closes Nav –>

    <div class=”topcurvewhite”></div>
    <div id=”main”>

    Cheers
    Perry

    Technokinetics

    (@technokinetics)

    For some reason your theme uses its own function, get_the_pa_ges(), instead of WP’s native wp_list_pages().

    Try changing “order by ID” to “order by menu_order”.

    – Tim

    Thread Starter perryg

    (@perryg)

    Thanks Tim, that sorted it out.
    Cheers
    Perry

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘order pages tabs across top of site’ is closed to new replies.