Jump to content

Wordpress page order issue


jarvis

Recommended Posts

Hi All,

 

Building a site with wordpress and want to show which page your on with the nav, as such the following code works:

	<?php
foreach(get_pages('childof=0') as $p) {
  if($p->post_parent == 0) {
    $lc = ($p->ID == $wp_query->post->ID) ? ' class="active"' : '';
	echo '<li><a href="'.get_permalink($p->ID).'" title="'.$p->post_title.'"'.$lc.'>'.$p->post_title.'</a></li>';
  }
}
?>	

Problem is, it's stopped the page order plug in I use working and just lists the pages automatically in alphabetical order. Is there any way I can alter the above to stop this?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/207108-wordpress-page-order-issue/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.