I need to edit wp_list_pages where in the world is it.


Author Message
Nicholas

Posted: 8/21/2009
Quote message 

Hello,

I am trying to find where the templates pull in wp_list_pages, but am unable to find where it is at.

After reading the codex
http://codex.wordpress.org/Template_Tags/wp_list_pages

I want to replace my current page list with the following. I need to know where to place this code, or what to replace this code over.









<?php
if(!$post->post_parent){
// will display the subpages of this top level page
$children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
}else{
// diplays only the subpages of parent level
//$children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0");

if($post->ancestors)
{
// now you can get the the top ID of this page
// wp is putting the ids DESC, thats why the top level ID is the last one
$ancestors = end($post->ancestors);
$children = wp_list_pages("title_li=&child_of=".$ancestors."&echo=0");
// you will always get the whole subpages list
}
}

if ($children) { ?>
<ul>
<?php echo $children; ?>
</ul>
<?php } ?>

 
Nicholas

Posted: 8/21/2009
Quote message 

ok so I found where wp_list_pages is but it is listed a few times. how do I add..


<?php

if(!$post->post_parent){

// will display the subpages of this top level page

$children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");

}else{

// diplays only the subpages of parent level

//$children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0");



if($post->ancestors)

{

// now you can get the the top ID of this page

// wp is putting the ids DESC, thats why the top level ID is the last one

$ancestors = end($post->ancestors);

$children = wp_list_pages("title_li=&child_of=".$ancestors."&echo=0");

// you will always get the whole subpages list

}

}



if ($children) { ?>

<ul>

<?php echo $children; ?>

</ul>

<?php } ?>



to



unction art_menu_items()

{

global $artThemeSettings;

if (true === $artThemeSettings['menu.showHome'] && 'page' != get_option('show_on_front'))

echo '<li><a' . (is_home() ? ' class="active"' : '') . ' href="' . get_option('home') . '">'.$artThemeSettings['menu.topItemBegin']

. $artThemeSettings['menu.homeCaption'] . $artThemeSettings['menu.topItemEnd'] . '</a></li>';

add_action('get_pages', 'art_header_page_list_filter');

add_action('wp_list_pages', 'art_list_pages_filter');

wp_list_pages('title_li=');

remove_action('wp_list_pages', 'art_list_pages_filter');

remove_action('get_pages', 'art_header_page_list_filter');

}



with out messing up the function?

Nicholas
 
Nicholas

Posted: 8/21/2009
Quote message 

nope that is not it.. I am looking for the one for the sidebar.


Nicholas
 
Garry

Posted: 8/21/2009
Quote message 

As you know wp_list_pages is in functions.php of your theme files but Artisteer use some variable in that template tag so if you just replace the code with your ready-made one your theme no longer will have access to those variables and will stop picking pages.

Can I know what functionality do you want to add with that code
 
Nichoals

Posted: 9/3/2009
Quote message 

I am trying to have the sidebar page list only list the top level pages, and then when on a top level page it will display the childs for that page.

I will look around for a plugin, but I think with the Artisteer menus it won't work. Or if you know of a plugin that could do slide out menus for pages maybe?

Nicholas

quote=Garry]
As you know wp_list_pages is in functions.php of your theme files but Artisteer use some variable in that template tag so if you just replace the code with your ready-made one your theme no longer will have access to those variables and will stop picking pages.

Can I know what functionality do you want to add with that code


 
Saluma

Posted: 9/4/2009
Quote message 

Hi

This plugin widget solved it for me:

Sub Pages widget
Show only the sub pages, if the current page has sub pages
Version 1.1 | By Alper Haytabay

Saluma
 
Garry

Posted: 9/4/2009
Quote message 

Following plugin may work for you: http://srinig.com/wordpress/plugins/flexi-pages/