How to disable alphabetical sorting page

If you look at get_pages() in the Code Reference you’ll notice two parameters: sort_order and sort_column. So, the following example will give you child pages list sorted by menu_order: $pages = get_pages( array( ‘child_of’ => $post->ID, ‘post_type’ => ‘page’, ‘post_status’ => ‘publish’, ‘sort_column’ => ‘menu_order’, ‘sort_order’ => ‘desc’, ) ); You can change menu order … Read more

Create a list of pages excluding children of selected page

//Create an array containing the IDs of pages that are children of page ID XXX $args = array( ‘post_type’ => ‘page’, ‘post_parent’ => XXX, ‘fields’ => ‘ids’, ‘posts_per_page’ => -1, ); $qry = new WP_Query($args); //Convert the array into a string $string = implode(‘, ‘, $qry->posts); //Display the list of IDs – for testing purposes. … Read more

Child and Parent Pages list of sub pages

You need to work out what page level you are on first, so that you know the correct ID to pass to the child_of argument of wp_list_pages. Give this a try: global $post; $page_level = 0; $post_parent = null; // Work out what page level we’re on if($post->post_parent > 0) { $post_parent = get_post($post->post_parent); $page_level … Read more

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