Change Parent Name with wp_list_pages?

You could of course use some preg_replace() tricks to solve this, but here’s a little (untested) idea using the the_title filter instead: add_filter( ‘the_title’, ‘wpse_title’ ); $children = wp_list_pages(“title_li=&include=”.$post->post_parent.”&echo=0″); where our filter callback is: function wpse_title( $title ) { remove_filter( current_filter(), __FUNCTION__ ); return __( ‘Overview’ ); } Remark 1: I think you should consider … Read more

Do Not Display Parent Page if No Subpages

Personally, I think this is the neatest, least intensive (database querying) solution: <?php $parentid = $post->post_parent ? @ array_pop( get_post_ancestors( $post ) ) : $post->ID; $children = wp_list_pages( array( “child_of’ => $parentid, ‘title_li’ => ”, ‘echo’ => false, ) ); if ( $children ) : ?> <ul class=”subpages”> <li><a href=”https://wordpress.stackexchange.com/questions/135921/<?php echo get_permalink( $parentid ) ?>”><?php … Read more

Custom category listings

WordPress automatically creates an archive for each category. If you look in wp-admin, under Posts > Categories, you can click “view” to view a category and that will show you what it looks like and what the URL is. It is possible that a theme could override this functionality, but it’s unlikely. Most themes have … Read more

wp_list_pages – Using a Walker to customize output order

wp_list_pages( $args ) calls get_pages( $args ). You can filter the get_pages() output with a filter on get_pages. Let’s say you call wp_list_pages() like this: wp_list_pages( array( ‘please_filter_me’ => TRUE ) ); You can sort the pages now with code like this (not tested): add_filter( ‘get_pages’, function( $pages, $args ) { // not our query … Read more

Setting multiple values to as sort_column

get_pages explodes sort_column on the comma (,) character. Just check the source: foreach ( explode( ‘,’, $sort_column ) as $orderby ) { So the correct format should be the first one you posted: $args = array( ‘sort_order’ => ‘ASC’, ‘sort_column’ => ‘menu_order, post_title’ ); $children = get_pages($args); If you are not seeing the ordering you … Read more

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