Sort and display pages with specific custom field (not tag)

Thanks @PieterGoosen and @realloc. I came up with this solution: Added meta_key=important&meta_value=1 in wp_list_pages(). And gonna use custom field for pages important: 1. This is for list of IMPORTANT child pages. function important_list_child_pages() { global $post; if ( is_page() && $post->post_parent ) $childpages = wp_list_pages( ‘meta_key=important&meta_value=1&sort_column=menu_order&title_li=&child_of=” . $post->post_parent . “&echo=0’ ); else $childpages = wp_list_pages( … Read more

How to hightlight all ancestor menu items of a child page NOT displayed in menu

You are checking against just one parent item. Instead, you might check against all of the parents <?php //in functions.php add_filter(‘nav_menu_css_class’, ‘highlight_portfolio’, 12, 2); function highlight_portfolio($classes, $item) { $parents = get_post_ancestors(); if ( 0 < count($parents) ) { if ( in_array( $item->object_id, $parents ) { array_push( $classes, ‘current-menu-ancestor’ ); } } return $classes; } Notice … Read more

Do we need to change our child function.php to require/include child dir files when we add an over-riding file.php into the child theme

Ok, the first-thing I wanted to double-check is that rather than make any modifications to parent PHP, you simply create one with a duplicate name in the child directory which completely overrides the parent file? No. You don’t create a theme with the same name. You create a theme with whatever name you choose and … Read more

Get WordPress Child Page IDs

$args = array( ‘post_type’ => ‘page’, ‘post_parent’ => ‘your_parent_page_ID’, ); $query = new WP_Query( $args ); if ( $query->have_posts() ) : echo ‘<ul>’; while ( $query->have_posts() ) : $query->the_post(); echo ‘<li>’ . get_the_ID() . ‘</li>’; endwhile; echo ‘</ul>’; endif; wp_reset_postdata(); Put your parent page ID intead of your_parent_page_ID and you will recieve list with child … Read more

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