List all files from subpages
List all files from subpages
List all files from subpages
You could go to the wordpress menu and make the target of the link a #. If the user clicks on it, they are taken to the top of the page where they probably are anyway since they’re using the navigation.
OK, I almost got it now… I extended the Walker_Page Class: class Walker_Child_Classes extends Walker_page { function start_el(&$output, $page, $depth, $args, $current_page) { if ( $depth ) $indent = str_repeat(“\t”, $depth); else $indent=””; extract($args, EXTR_SKIP); $output .= $indent . ‘<li class=”‘ . apply_filters( ‘the_title’, $page->post_name, $page->ID ) . ‘”><a href=”‘ . get_page_link($page->ID) . ‘” title=”‘ … Read more
Hmm, given that it’s okay to send the visitor to an entirely different site, but you are trying to get it to show up as a page, I would suggest adding it to a menu. You are probably already aware, but when you are modifying menus (Appearance > Menus) there is a box on the … Read more
You will get better results and more control using the wp_nav_menu function as it allows you to control the menu items.
Simply add the filter before the call and remove it afterward something like this <ul id=”headerlinks”> <?php add_filter(‘wp_list_pages’, ‘add_markup_pages’); wp_list_pages(‘title_li=&include=24,26,28,30’); remove_filter(‘wp_list_pages’, ‘add_markup_pages’); ?> </ul>
You can use the following filter: add_filter(‘wp_list_pages’, ‘foo_bar’); function foo_bar($html){ //Create a regex pattern to identify the LI element with preg_match //Create another pattern to identify the class attr and alter it with preg_replace return $html; } As I’m not familiar with the exact elements you are working with, I can’t write up a regex … Read more
Using the new menu system, as far as I know I can set a page which is actually itself a child page (in the pages section) to be a parent of a page which is actually itself a parent= TRUE What is normaly done on a site that doesn’t use wp_list_pages? I can’t speak for … Read more
You can hook into the edit_posts_per_page filter that fires in WP_List_pages right before the pagination is determined. add_action( ‘edit_posts_per_page, ‘limit_list_pages’ ); function limit_list_pages() { $post_type=”post”; $edit_per_page=”edit_” . $post_type . ‘_per_page’; $per_page=(int)get_user_option( $edit_per_page ); if ( empty( $per_page ) || $per_page < 1 ) $per_page=10; //<— Change this to your new per page number return $per_page; … Read more
You have to pass the parent page id to the wp_list_pages function instead of the global $post->ID in your subpages. function wpse33151_getSubpages() { global $post; $parents = get_post_ancestors($post->post_id); krsort($parents); $parents = array_merge(array(), $parents); if (is_home() || is_single()) { $id = get_option(‘page_for_posts’); $parent = get_post_ancestors($id); $id = $parent[0]; } elseif($parents) { $id = $parents[0]; } else … Read more