Exclude pages by custom field (with yes/no) storing wrong data?
Exclude pages by custom field (with yes/no) storing wrong data?
Exclude pages by custom field (with yes/no) storing wrong data?
I ended up running the function twice on itself. That way, once the walker updated the last element, it went back up to the top to update the first.
you need to sert the ‘echo’ parameter of wp_list_pages() to 0 (zero): $return_string .= wp_list_pages(‘sort_column=menu_order&title_li=&echo=0’);
No, it is not possible. you will want to use WP_Query() Here is the Codex Article on that. Example: <?php // Query All Pages $my_query = new WP_Query( ‘post_type=page’ ); // The Loop while ( $my_query->have_posts() ) : $my_query->the_post(); echo ‘<h2>’ . get_the_title() . ‘</h2><p>’ . get_the_excerpt() . ‘</p>’; endwhile; ?>
You can manage that with a single menu, and using CSS you can style to function the way you have described very easy.
It sounds like you just need wp_reset_postdata() after you run any extra queries, and before you output your menu.
Use the WordPress Menu system, which allows you to set custom classes (Make sure you open up “Screen Options” and check the “CSS Classes” check box to see the settings)
I went to the #wordpress irc channel and was given the answer by Marko Heijnen. He grabbed the Walker Code from /wp-includes/post-template.php and added a few lines to it. /** * Extend the default page walker class to append class names for pages that * are parents. * @uses Walker_Page * * http://wordpress.stackexchange.com/questions/11821/class-parent-for-wp-list-pages * */ … Read more
By default the function cannot do this, but you can specify a custom walker when you call the function, and then implement your own walker: http://bugssite.org/blog/2009/12/08/wordpress-custom-walker-tutorial/ http://www.wprecipes.com/how-to-modify-lists-like-categories-and-blogroll-in-wordpress This way you can keep the code the same, but add a check on the date of the page being walked over, and ‘skip’ it if it doesn’t … Read more
wp_list_categories() Would be the way to go for taxonomies. Further functionality can be done either with a custom walker on this function (This seems to be the one resource: http://scribu.net/wordpress/extending-the-category-walker.html) or write a custom SQL script. In the end, I went with wp_list_pages and sorted by custom post type where: post_type => ‘custom-post-type’ is listed … Read more