Customize the output of wo_list_pages
-
I am listing the pages in a sidebar.php file using the function “wp_list_pages” …I need to display the output as expandable collapsible menu if the page has child pages. If no child pages, then just display that page name(that i am getting). But some pages have child pages and those child should be displayed in expandable collapsible menu.
My code is
if($post->post_parent) {
$parentpageid=$post->post_parent;?>
<ul >
<?php $children = wp_list_pages(“title_li=&child_of=”.$post->post_parent.”&echo=0″.”sort_column=’menu_order'”); ?><?php
if($parentpageid==’386′ || $parentpageid==’384′ )
{
if($parentpageid==’386′) {?>- <?php $emplinks = wp_list_pages(“include=384&title_li=&depth=1”); ?>
<?php
}
if($parentpageid==’384′)
{
?>- <?php $emplinks = wp_list_pages(“include=386&title_li=&depth=1”); ?>
<?php
}
}}>?
Can you please help me.
Thanks,
Priya -
-
-
What is the URL of the blog with the Custom Design upgrade? http://priyarenjit.wordpress.com/ does not have it.
-
And I highly doubt by the content of this post that the site in question is even hosted on WordPress.com since we cannot edit underlying PHP files.
More likely you’ve wandered into the wrong forum and need to be over at support for self-hosted WordPress installs. http://wordpress.org/support/
For clarity: http://support.wordpress.com/com-vs-org/
-
I am not doing anything in that url..The code which i have pasted is from my application .Can u pls help me to apply css on the dynamically generating page lists?
Thanks,
Priya -
Then please give us the URL of where you want to use this, starting with http://
We cannot edit PHP on WordPress.com sites, which is why I suspect you are in the wrong forum.
- The topic ‘Customize the output of wo_list_pages’ is closed to new replies.