My goal is to list all the pages names as well as the "attached files" of these pages on a separate overview page in wordpress. I have 100 pages with each between 0 and 4 attached PDF files (linked inside the content, but could be uploaded as attachement to the page also). The overview page should then list all these pages like this: - page name 1 -- pdf file 1-1 -- pdf file 1-2 [..] - page name 2 …
Im trying to show a box on left sidebar with links of current page's sub menus. but order is not applying same as menu! whats the problem? <div class="sidebar-box"> <div class="sidebar-box-title"> <h4><?php echo get_the_title($post->post_parent); ?></h4> </div> <ul class="links"> <?php wp_list_pages('sort_order=asc&title_li=&sort_column=menu_order&depth=1&child_of='.$post->post_parent); ?> </ul> </div> DEMO: http://www.testhosting.co.uk/speedshealthcare/healthcare-supplies/care-home-pharmacy/
I have the following navigational structure in WordPress: Page Sub Page Child Page Child Page Child Page Page Sub Page Child Page Child Page Child Page Page Sub Page Child Page Child Page Child Page On each Sub Page and Child Page, I want to display the following in the sidebar: Sub Page Child Page Child Page Child Page The closest I've come to this is the following code from here: <ul> <?php global $post; $current_page_parent = ( $post->post_parent ? …
I would like a navigation something like this. Home - People - About - Services - Contact Home, About, Services and Contact are all pages. People DOES NOT have a page, I would like to use this link to open a second Navigation. Is it possible to add a link in wp_list_pages that doesn't link to a page. Is it also possible to add a id to this link that doesn't have a page. I would like the code to …
I have a series of "Thank You" pages which result from different form submissions. I would like to be able to exclude these from sitemaps based on their template. Specifically, and as an easy example, excluding them from being listed on the basic 404 page which utilizes the wp_list_pages. I know how to manually exclude by ID but am looking for a better way to do this on scale and a more simplified approach--rather than having to edit code. Is …
I'm trying to make a shortcode I can put into a widget that will show the siblings if there are any otherwise show the children. Here is my code I've started with: //sidebar siblings menu function rt_list_children() { global $post; $page = $post->ID; if ( $post->post_parent ) { $page = $post->post_parent; } $children = wp_list_pages( array( 'child_of' => $page, 'title_li' => '', 'echo' => '0', ) ); if ($children) { $output = '<ul>'; $output .= $children; $output .= '</ul>'; } …
I am looking for a way to output all page IDs from the following menu: <?php wp_list_pages('depth=1&exclude='3,5,11')); ?> Only top level pages needed, therefore the 'depth=1'. Any help appreciated.
I have this code to list my parent page and all pages under it on the sidebar. It shows both parent and child pages on first two levels but when I open a third level page, it only shows the current page on the sidebar. How can I modify this to show parent page and all child pages, no matter how many levels of child pages I have. CODE: <?php if ( $post->post_parent ) { $children = wp_list_pages( array( 'title_li' …
I'm using wp_list_pages() like so: <?php wp_list_pages('title_li=&include=1714'); ?> But would like it so that the link has a current_page_parent class under the following conditions: if (is_singular('work')) { Is this achievable with this function?
I'm trying to build a three menu from a custom post type, and wanna build a complet three from the posts children and parents, with all levels both up and down included. And actually the function wp_list_pages()does that really great, and actually includes all levels that i want. But i also want to modify the query a little, and exclude some post that fits within a meta query, that i'm using another place like this: $meta_query[] = array( 'relation' => …
In some cases it might be useful to use multiple post & page parameters in your WP_Query object. In my case, I would like to display children of a parent page including the parent page itself. Visualization of what I want to achieve. Imagine the following pages hierarchically sorted as following: page A page B Child page A Child page B Child page C page C The bold list items are the posts/pages I want to retrieve. My first thoughts …
One of my customer has many pages that have the same titles, although their content is different. They would like to be able to give them "admin titles" in order to differentiate them in the admin list. I was thinking of adding an ACF extra field "Admin Title". If this field is filled, then on the page listing in the admin, I would like to use it. Is there an admin filter that is called when generating the page list …
I'm trying to build a nav out of an array of child pages from a custom post type called "section" with a parameter depth of 1. I want to slice this array so that it only displays a part of the array. When I try array_slice() or array_chunk() and then wp_list_pages() to display the pages, it returns everything from the Pages content type and it doesn't split up the array either. What am I doing wrong? <?php $arr = array( …
I am using wp_list_pages to display our website's navigation. The nav is supposed to be 2nd level pages only. I want the nav to display the array's first four items and then nest the rest of the items in a "more" dropdown. What I'm trying to do is split the array so that the last few list items can be located in a different HTML tag that contains the more dropdown. To display the first four items, I use 'include', …
How can i make a simple filter to display only specific pages (include instead of exclude) as an output to wordpress pages widget? I made this code , but its not working function specific_pages($output) { $args = array( 'include' => array(147,12,32), ); $output = get_posts($args); return $output; } add_filter('wp_list_pages', 'specific_pages');
I want the parent post and its children posts. I don't know the parent post ID, only that its post_password field is not empty. It's very similar to this question except the post ID is not known in my case.
I am trying to list pages for a specific ID but want to include the parent page in the list <?php $parent = 83; wp_list_pages( array( 'title_li' => '', 'child_of' => $parent, ) ); ?> I tried adding 'include' => 83 but then it only listed the parent and not the children.