WordPress.org

Ready to get started?Download WordPress

Forums

My Page Order
not changing the order on the site (50 posts)

  1. Teschandorff
    Member
    Posted 3 years ago #

    I installed the My page order plugin and it appears to work well in the administrative screens. When I drag my pages into the order that I want and tell it to set the order it appears to do so and it changes how they appear in the dashboard/pages screen. It does not however change how they are ordered when I view the page. I am using the Picture Perfect theme with a sliding menu. my web address is http://www.schandorfffamily.com. I know you have probably already answered this question for others by I couldn't tell if that answer applied to me and the theme I am using. If I do need to change the code please be specific about where to change it because I do not have much PHP experience.
    thanks for a good plugin and the help.

    Tim

  2. froman118
    Member
    Plugin Author

    Posted 3 years ago #

    Yup, looks like it is hardcoded to use the page ID. In header.php on about line 50 there's this line:

    <?php slider_menuparse(wp_list_pages('sort_column=ID&depth=1&number=7&title_li=&echo=0')); ?>

    replace it with this:

    <?php slider_menuparse(wp_list_pages('sort_column=menu_order&depth=1&number=7&title_li=&echo=0')); ?>

    That should do it.

  3. Teschandorff
    Member
    Posted 3 years ago #

    thanks for the help. Got it all figured out and you are right that was the problem.

    Tim

  4. hisforhome
    Member
    Posted 3 years ago #

    Hi,

    I seem to be having the same problem as Tim. I'm using the Dirtylicious theme and have found wp_list_pages('depth=1&title_li=&before=–') in my header.php Is this what's causing my problem, and if it is, what do I replace it with?

    The site I'm working on is http://www.picturehouseantiques.co.uk

    Thanks!

  5. froman118
    Member
    Plugin Author

    Posted 3 years ago #

    hisforhome,

    Take that line and switch it to this:

    wp_list_pages(sort_column=menu_order&'depth=1&title_li=&before=–')

    That should get things ordered correctly.

  6. hisforhome
    Member
    Posted 3 years ago #

    Hi froman118,

    Thanks for your help. I've just updated the line to what you said but I now get a HTTP - 500 Internal Server Error message

  7. froman118
    Member
    Plugin Author

    Posted 3 years ago #

    Oops sorry, misplaced the quote:

    wp_list_pages('sort_column=menu_order&depth=1&title_li=&before=–')

  8. hisforhome
    Member
    Posted 3 years ago #

    Thanks again froman118,

    This time I didn't get an error message, the pages have just lost all their formatting

    Thanks,
    hisforhome

  9. froman118
    Member
    Plugin Author

    Posted 3 years ago #

    Copy and paste the whole header.php in here, there's something wrong with the syntax.

  10. hisforhome
    Member
    Posted 3 years ago #

    Hi froman118<

    Thanks again for all your help. Here's the whole thing:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml">

    <head profile="http://gmpg.org/xfn/11">

    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />

    <title><?php bloginfo('name'); ?><?php if ( is_single() ) { ?> » Blog Archive <?php } ?><?php wp_title(' » '); ?></title>

    <meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats -->

    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />

    <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 class="outer-container">

    <div class="inner-container">

    <div class="header">

    <div class="title">

    <span class="sitename">/"><?php bloginfo('name'); ?></span>
    <div class="slogan"><?php bloginfo('description'); ?></div>

    </div>

    </div>

    <div class="path">

    /">Home

      <?php wp_list_pages('depth=1&title_li=&before=–');?>

    </div>

    <div class="main">

    <div class="content">

  11. froman118
    Member
    Plugin Author

    Posted 3 years ago #

    You should be alright, I still had a window open of your site when I first looked at it and they links across the top looked the same. It also looks the same as this demo, http://templates.arcsin.se/demo/dirtylicious-wordpress-theme/

  12. hisforhome
    Member
    Posted 3 years ago #

    Sorry, I've not been terribly clear. I want to change the order of the sub pages of the "Dealers" page down the left column.

    Thanks

  13. hisforhome
    Member
    Posted 3 years ago #

    ...so I guess that means the sub-sub pages :)

  14. froman118
    Member
    Plugin Author

    Posted 3 years ago #

    Ahhh ok, in functions.php replace existing wp_list_pages() call with this:

    wp_list_pages('sort_column=menu_order&title_li=&child_of='.$subpages);

  15. hisforhome
    Member
    Posted 3 years ago #

    Whoops- just tried that and I'm getting another HTTP - 500 Internal Server Error message!

  16. froman118
    Member
    Plugin Author

    Posted 3 years ago #

    It should be fine check for types, whole function would look like this:

    function the_subpages()
    {
    	global $post, $wpdb;
    
    	if ( is_page() )
    	{
    		if ( $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_type='page' AND post_parent = ".$post->ID) > 0 ){
    			$subpages = $post->ID;
    		}
    		else if ( $post->post_parent != 0 ){
    			$subpages = $post->post_parent;
    		}
    
    		if ($subpages)
    		{
    			echo '<h2>Subpages</h2>' . "\n";
    			echo '<ul>' . "\n";
    			wp_list_pages('sort_column=menu_order&title_li=&child_of='.$subpages);
    			echo '</ul>' . "\n";
    		}
    	}
    }
  17. hisforhome
    Member
    Posted 3 years ago #

    Got the server error to stop now, but in admin when I drag & drop using "My PagerOrder" to reorder the 'dealers' sub-pages it still keeps them in alphabetical order on the front end.

  18. froman118
    Member
    Plugin Author

    Posted 3 years ago #

    Not sure what to tell you, the last change I gave you should have worked. As long as you tell the wp_list_pages function to sort by "menu_order" it should use the order you specify.

  19. hisforhome
    Member
    Posted 3 years ago #

    Big thanks for all your help - I think I'll uninstall & reinstall My Page Order & see if that helps

  20. JR216
    Member
    Posted 3 years ago #

    G'day

    I am quite a novis at WordPress and am having a similar problem with various other members; I have the fastfood theme and installed the WP My Page Order plugin, and can't seem to change the order of the menu items.

    The only area I can find to change it is in the functions.php.

    I have attached the relevant code where I assume would need editing?

    [Code moderated as per the Forum Rules. Please use the pastebin]

    I have tried different options as mentioned in similar posts, simply as trial and error but still unsuccessful. I can get the sub-menu items to reorder as I want, but not the pages listed on top of the menu bar.

    Any idea how to resolve this?

    Thanks in advance.

  21. froman118
    Member
    Plugin Author

    Posted 3 years ago #

    JR,

    Switch this:

    $pages = get_pages( 'parent=0' );

    to this:

    $pages = get_pages( 'sort_column=menu_order&parent=0' );

  22. jennsweet1
    Member
    Posted 3 years ago #

    Hello,

    When I look up php files...it looks different than above. I'm not even sure if I'm looking in the right file.

    My pages are not in the order I want them to be.

    Below is the code from functions.php (zeta theme).

    [Code moderated as per the Forum Rules. Please use the pastebin]

    What do I need to change to get the Page Order working?

    http://blog.elsaisaac.com/

    Thanks.

    JJ

  23. froman118
    Member
    Plugin Author

    Posted 3 years ago #

    JJ,

    Switch this:

    ORDER BY $wpdb->posts.post_title ASC

    to this:

    ORDER BY $wpdb->posts.menu_order ASC

    That should get it in the right order.

  24. jennsweet1
    Member
    Posted 3 years ago #

    Wonderful!

    Works perfectly now!

    Thanks so much! :-)

  25. ekemler
    Member
    Posted 3 years ago #

    Hi Froman118,

    I looked at your advice for someone earlier- I am trying to order my pages and it worked- but now the sub pages have disapeared. Do you know how I can fix this? I have a stitchpress theme and you said to go into functions but I don't have that. I have theme function, header, etc. Where would i find the command for sub pages?

    Brittany

  26. froman118
    Member
    Plugin Author

    Posted 3 years ago #

    Brittany,

    Are you on this Stitchpress theme?

    http://www.jinsonathemes.com/demo/?themedemo=stitchpress

    What did you do before to get the pages ordered correctly?

    Andrew

  27. straighte180
    Member
    Posted 3 years ago #

    OK my turn to ask froman something! I need my subpages to order correctly (as they do in admin)

    I have put in 'sort_column=menu_order' into...

    foreach($children as $child) {
    $tabs .= wp_list_pages('title_li=&include='.$child->ID.'&echo=0&sort_column=menu_order');
    }

    ... to no avail.

    here is the full code for my sidebar.php

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Thankyou!!

  28. straighte180
    Member
    Posted 3 years ago #

    I looked in my Zen theme's functions.php. It may have something to do with this?

    // Register sidebar widgets
    if (function_exists('register_sidebar')) {
    	register_sidebar(array(
    		'name'=> 'Top Tabs',
    		'id' => 'top_tabs',
    		'before_widget' => '<li id="%1$s" class="widget %2$s">',
    		'after_widget' => '</li>',
    	));
    	register_sidebar(array(
    		'name'=> 'Right Sidebar',
    		'id' => 'right_sidebar',
    		'before_widget' => '<li id="%1$s" class="widget %2$s">',
    		'after_widget' => '</li>',
    		'before_title' => '<h3>',
    		'after_title' => '</h3>'
    	));
    }
    
    ?>

    Thanks again!!

  29. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

    That's just the code to set up widget areas in the top and side menu.

  30. straighte180
    Member
    Posted 3 years ago #

    Yes, I see that now. Thanks esmi

    For the Zen theme here is the solution: for subpages you need to define the menu order in the get_pages() function before it gets to the wp_list_pages() function

    I hope that helps someone!

    if (is_page()) {
    	$this_page = $post->ID;
    	if ($post->post_parent) $this_page= $post->post_parent;
    	$children = get_page_children($this_page, get_pages('sort_column=menu_order'));
    	if($children) {
    		$tabs .= "<li>\n".'<ul class="subpages">';
    		foreach($children as $child) {
    			$tabs .= wp_list_pages('title_li=&include='.$child->ID.'&echo=0');
    		}
    		$tabs .= '</ul></li>';
    	}
    }

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic