Changing page orders
-
I am in the middle of giving a site a makeover (https://www.bingoformen.com) and installed a new template that I really like but unfortunately the pages will go into the order I want them. I have given all of the pages numbers but its still not working.
Does anyone know how I can edit this to get it working?
Thanks in advance
-
Hi
In your header.php file, locate
wp_list_pages(' ...stuff here ... ')
if within
...stuff here...
you seesortcolumn=..something..
change
..something..
to menu_order
so it looks likesort_column=menu_order
if you don’t seesortcolumn=..something..
just before the closing apostrophe (or could be a double quote )
add this&sort_column=menu_order
so it now looks like
wp_list_pages(' ...stuff here ...&sort_column=menu_order')
Save, and refresh your website. THAT should cause them to sort in the order you want.Thanks for reply, I tried that but its had a really wierd effect on the menus, I have left it up for you to see.
This is the original, header code:
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”https://www.w3.org/1999/xhtml”><head profile=”https://gmpg.org/xfn/11″>
<meta http-equiv=”Content-Type” content=”<?php bloginfo(‘html_type’); ?>; charset=<?php bloginfo(‘charset’); ?>” /><title><?php bloginfo(‘name’); ?><?php wp_title(); ?></title>
<meta name=”generator” content=”WordPress <?php bloginfo(‘version’); ?>” /> <!– leave this for stats –>
<style type=”text/css” media=”screen”>
@import url( <?php bloginfo(‘stylesheet_url’); ?> );
</style><link rel=”alternate” type=”application/rss+xml” title=”RSS 2.0″ href=”<?php bloginfo(‘rss2_url’); ?>” />
<link rel=”alternate” type=”text/xml” title=”RSS .92″ href=”<?php bloginfo(‘rss_url’); ?>” />
<link rel=”alternate” type=”application/atom+xml” title=”Atom 0.3″ href=”<?php bloginfo(‘atom_url’); ?>” />
<link rel=”pingback” href=”<?php bloginfo(‘pingback_url’); ?>” /><?php wp_get_archives(‘type=monthly&format=link’); ?>
<?php wp_head(); ?>
</head>
<body>
<div id=”rap”>
<div id=”top”><div id=”topleft”>
<ul id=”menu”>
<li<?php if(!is_page() ) { ?> class=”current_page_item”<?php } ?>>“>Home
<?php wp_list_pages(‘sort_column=post_date&title_li=’); ?></div>
<div id=”topright”>
<form class=”searchform” method=”get” action=”<?php bloginfo(‘url’); ?>/”>
<fieldset>
<label><?php _e(‘Search our blog’); ?></label>
<input type=”text” value=”<?php the_search_query(); ?>” name=”s” class=”searchinput” />
<input type=”submit” value=”” class=”searchbutton” />
</fieldset>
</form>
</div></div>
<div id=”header”>
<div class=”header-title”>/”><?php bloginfo(‘name’); ?></div>
<div class=”header-description”><?php bloginfo(‘description’); ?></div><div class=”ads”><h2></h2>
<?php advertisement(); ?>
</div></div>
<div id=”category”>
<div id=”categoryx”>
<ul id=”dcategory”>
<?php global $video; ?>
<?php wp_list_categories(‘hide_empty=0&title_li=&exclude=’.$video); ?></div>
<div id=”categoryy”></div>
<div class=”clear”></div>
</div>
<?php get_sidebar(); ?>
<div id=”content”>
<!– end header –>stvwlf has given you the solution above, i can see the area mentioned right there in the code…
Follow the instructions first, then report back if you have a problem, the above code is not as per stvwlf’s example.
I did the changes as suggested:
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”https://www.w3.org/1999/xhtml”><head profile=”https://gmpg.org/xfn/11″>
<meta http-equiv=”Content-Type” content=”<?php bloginfo(‘html_type’); ?>; charset=<?php bloginfo(‘charset’); ?>” /><title><?php bloginfo(‘name’); ?><?php wp_title(); ?></title>
<meta name=”generator” content=”WordPress <?php bloginfo(‘version’); ?>” /> <!– leave this for stats –>
<style type=”text/css” media=”screen”>
@import url( <?php bloginfo(‘stylesheet_url’); ?> );
</style><link rel=”alternate” type=”application/rss+xml” title=”RSS 2.0″ href=”<?php bloginfo(‘rss2_url’); ?>” />
<link rel=”alternate” type=”text/xml” title=”RSS .92″ href=”<?php bloginfo(‘rss_url’); ?>” />
<link rel=”alternate” type=”application/atom+xml” title=”Atom 0.3″ href=”<?php bloginfo(‘atom_url’); ?>” />
<link rel=”pingback” href=”<?php bloginfo(‘pingback_url’); ?>” /><?php wp_get_archives(‘type=monthly&format=link’); ?>
<?php wp_head(); ?>
</head>
<body>
<div id=”rap”>
<div id=”top”><div id=”topleft”>
<ul id=”menu”>
<li<?php if(!is_page() ) { ?> class=”current_page_item”<?php } ?>>“>Home
<?php wp_list_pages(‘sort_column=menu_order’); ?></div>
<div id=”topright”>
<form class=”searchform” method=”get” action=”<?php bloginfo(‘url’); ?>/”>
<fieldset>
<label><?php _e(‘Search our blog’); ?></label>
<input type=”text” value=”<?php the_search_query(); ?>” name=”s” class=”searchinput” />
<input type=”submit” value=”” class=”searchbutton” />
</fieldset>
</form>
</div></div>
<div id=”header”>
<div class=”header-title”>/”><?php bloginfo(‘name’); ?></div>
<div class=”header-description”><?php bloginfo(‘description’); ?></div><div class=”ads”><h2></h2>
<?php advertisement(); ?>
</div></div>
<div id=”category”>
<div id=”categoryx”>
<ul id=”dcategory”>
<?php global $video; ?>
<?php wp_list_categories(‘hide_empty=0&title_li=&exclude=’.$video); ?></div>
<div id=”categoryy”></div>
<div class=”clear”></div>
</div>
<?php get_sidebar(); ?>
<div id=”content”>
<!– end header –>But now I have a little ‘pages[ next to home and all of the other pages only appear as I mouse over that and the bingo reviews list is all out of alignment.
That’s because you removed the title_li= part from the function…
As was indicated before, you are not to remove anything, simply replace the sort_column part…
Re-read the instructions… if you still don’t get it this time i’ll post it for you, but this really should be obvious..
Got it now thanks lol, can I blame it on a blonde moment
Yeah sure… ?? …have those myself, and i’m not even blonde ??
- The topic ‘Changing page orders’ is closed to new replies.