What about the depth parameter?
I looked into the depth parameter, but I need the other pages to display the subpages when they are clicked. Unless is there a way to specify the page depth for Page=Pictures?
The only way I can see it at this moment – to use a conditional tag to say something like:
if is_page(XX)
wp-list-pages with depth=1
else
wp-list-pages (normal)
ok, I think that would work… except for the sub-pages of Pictures, cause the id or page name would need to be added to the if statement. That solution will work for now though b/c I don’t plan on adding any subpages anytime soon.
I can’t seem to get this to work though… I’ve tried this:
<?php
if (is_page(‘Pictures’)) {
<?php wswwpx_fold_page_list(‘depth=-1’); ?>;
} else {
<?php wswwpx_fold_page_list(‘title_li=&sort_column=menu_order&page_id=’.$posts[0]->ID); ?>;
}
?>
which doesn’t work… which I thought might be b/c of the “<?php” and “?>” within the if statement. So I tried this:
<?php
if (is_page(‘Pictures’)) {
wswwpx_fold_page_list(‘depth=-1’);
} else {
wswwpx_fold_page_list(‘title_li=&sort_column=menu_order&page_id=’.$posts[0]->ID) ;
}
?>
Still nothing. :S
The page’s source is empty when I load it:
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.0 Transitional//EN”>
<HTML><HEAD>
<META http-equiv=Content-Type content=”text/html; charset=utf-8″></HEAD>
<BODY></BODY></HTML>
Try this (Warning: I not a coder!):
<?php
if (is_page('Pictures')) { ?>
<?php wswwpx_fold_page_list('depth=-1'); ?>
<?php } else { ?>
<?php wswwpx_fold_page_list('title_li=&sort_column=menu_order&page_id='.$posts[0]->ID); ?>
<?php } ?>
lol Thanks for your warning 😉
But I think you could be, cause it worked!
Well… almost perfect, I had to actually change it to:
<?php
if (is_page('Pictures')) { ?>
<?php wswwpx_fold_page_list('title_li=&sort_column=menu_order&page_id= && depth=-1'.$posts[0]->ID); ?>
<?php } else { ?>
<?php wswwpx_fold_page_list('title_li=&sort_column=menu_order&page_id='.$posts[0]->ID); ?>
<?php } ?>
so it would populate within the unordered list correctly!
Thank you very much! Kudos
Update – just in case someone else has a similar problem, thought I would post the finised product.
I also found a way to hide the child pages while viewing the child pages without having to add each additional page name or id to the original if statement. It’s a simple function that Nicholas Roussos put together.
Heres my final if statement:
<?php
if (is_page('Pictures')) { ?>
<?php wswwpx_fold_page_list('title_li=&sort_column=menu_order&page_id= && depth=-1'.$posts[0]->ID); ?>
<?php } elseif (is_child('23')) { ?>
<?php wswwpx_fold_page_list('title_li=&sort_column=menu_order&page_id= && depth=-1'.$posts[0]->ID); ?>
<?php } else { ?>
<?php wswwpx_fold_page_list('title_li=&sort_column=menu_order&page_id='.$posts[0]->ID); ?>
<?php } ?>