Tag Info

New answers tagged

1

No. Unfortunately you're looking at a walker, or a custom replacement function, as described here: http://stackoverflow.com/questions/12353076/wp-list-pages-isnt-showing-title-attribute


4

Great answers above. I took on the challenge trying to find yet another way to solve this. The exclude parameter: We could try: 'exclude' => wpse_exclude_drafts_branches() where: function wpse_exclude_drafts_branches() { global $wpdb; $exclude = array(); $results = $wpdb->get_col( "SELECT ID FROM {$wpdb->posts} where post_status = ...


2

This answer is offering another way of doing this. The code is pretty much self-explaining, I named everything pretty literal to make it better understandable. What I did is constructing a function that determines the draft pages and their descendants, which than can be used with the exclude parameter of wp_list_pages(). Helper Function: function ...


3

Making use of a custom Walker is actually not that hard, it basically goes like this: Create a class; A class is a collection of variables and functions working with these variables. By extending another one; The extended or derived class has all variables and functions of the base class [...] and what you add in the extended definition. ...


4

Sincerly I found custom walkers annoying: sometimes what can be done with a simple filter require an entire class to coded and, but probably it's me, I don't really like logic behind WordPress walkers. This is the reason why I often use a trick to filter elements before they are walked. It is a really simple Walker class: class FilterableWalker extends ...


0

You'll have to use this function get_queried_object_id(), if the ID returned by this function is equal to the ID of the page ($page->ID in your code), that's the current page. Based on that you can add a class.



Top 50 recent answers are included