wp_list_pages() exclude category

I think the solution that would work out best for you is just using your own query. Since you have modified pages to have categories and tags taxonomies wp_list_pages doesn’t support excluding the arguments quite like that. You could get an array of all page IDs that are assigned to each category, but you’d be … Read more

wp_list_pages() refuses to output posts

wp_list_pages will only output hierarchical post types. If we look at the function in source, we’ll see that it calls get_pages to load pages for output. If we look at get_pages function in source, we’ll see: // Make sure the post type is hierarchical $hierarchical_post_types = get_post_types( array( ‘hierarchical’ => true ) ); if ( … Read more

Get parent of current page

Try using get_post_ancestors. Here is how you can apply this in your case: <?php global $wp_query; $post = $wp_query->post; $ancestors = get_post_ancestors($post); if( empty($post->post_parent) ) { $parent = $post->ID; } else { $parent = end($ancestors); } if(wp_list_pages(“title_li=&child_of=$parent&echo=0” )) { wp_list_pages(“title_li=&child_of=$parent&depth=1” ); } ?> You’ll probably need to remove the depth parameters to show you’re 3rd … Read more

Exlude pages from wp_list_pages

I’m not entirely clear on what you are trying to do exactly because “I had to manually build another menu. I just created a list and inserted links to the pages I needed, without using any WordPress function.” didn’t make a whole lot of sense. You need to exclude pages by including the exclude parameter … Read more

Get the ID of the direct parent page

I’m assuming that you’re asking how to do it with code? (Doing it in backend is pretty easy – just try to edit parent page and see the ID in URL). So how to check post parent in code? It’s also very easy – direct parent is stored in post_parent property. If post has no … Read more

wp_list_page with something like showpost

Just pass number=5 and it should work since wp_list_pages() uses get_pages() which has number parameter, and also if you look at wp_list_pages codex entry at the bottom under change log you can see that it take the number parameter since version 2.8

List subpage of subpage

Here is a function that im using for submenus, maybe there is a better way to do this but i always ends up with this solution. Add this function to your theme functions.php file: function wpse_submenu( $id, $echo = false, $showParent = true, $depth = 0 ) { global $wpdb, $post, $before, $page_for_posts; // if … Read more

How to remove the HOME menu item

Here’s a good solution posted over at .org http://wordpress.org/support/topic/remove-home-from-menu-1#post-2215239 You can remove the “Home” link using a filter. Add this to your Theme’s functions.php file: function mytheme_nav_menu_args( $args ) { $args[‘show_home’] = false; return $args; } add_filter( ‘wp_nav_menu_args’, ‘mytheme_nav_menu_args’ ); And if you want to remove the “Home” link from the default fallback menu, add … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)