Schedule Page to Menu [duplicate]

I believe that this plugin will do what you want. Jamocreations Auto Submenu https://wordpress.org/plugins/auto-submenu/ Here is also a link to the author’s site, http://jamocreations.com/en/artikelen/auto-submenu , where he discusses why he built the plugin and also two other plugins that also work similarly. The advantage of the Jamocreations Auto Submenu plugin though is that if later … Read more

Best way to give site sub-page it’s own domain?

You are on the right track. Point your add-on domains to WordPress root Create WordPress landing pages Point to landing page using add-on domain Rel=canonical will prevent duplicate indexing penalty All landing page links will automatically point to canonical domain Naturally you will do all your editing from the canonical domain If you run into … Read more

Custom rewrite rule for hierarchical custom post type

You’re pretty close. Your rewrite rule is using the wrong query var, pagename should be just name. Here’s a version that works for me on a fresh 4.4.1 install and twentysixteen theme- function bvt_product_init() { $args = array( ‘label’ => __( ‘Product’, ‘domain’ ), ‘description’ => __( ‘Company products’, ‘domain’ ), ‘supports’ => array( ‘title’, … Read more

Show siblings (if any) and parents

As it stands your code almost works, but it checks to see if the current page has a parent, which will always be true for both 2nd and 3rd level pages. WordPress gives us get_ancestors to retrieve an ordered array of ancestors for any hierarchical object type: get_ancestors( $object_id, $object_type ); So we can use … Read more

How do I list the child of a child page [duplicate]

First of all, why you are querying for posts by your custom query? We have WP_Query class and get_posts function to do this. $child_pages = $wpdb->get_results(“SELECT * FROM $wpdb->posts WHERE post_parent = “.$post->ID.” AND post_type=”page” ORDER BY menu_order”, ‘OBJECT’); became $pages = get_posts(array( ‘post_type’ => ‘page’, ‘orderby’ => ‘menu_order’ ‘order’ => ‘ASC’ ‘posts_per_page’ => -1, … Read more

remove/hide pages from users backend

One way to achieve this is by looping through the parent pages and fetching their respective children pages ids. The resulting arrays can then be merged and used in the ‘post__not_in’ variable. add_filter( ‘parse_query’ , ‘exclude_pages_from_admin’ ); function exclude_pages_from_admin( $query ) { global $pagenow,$post_type; $pages = array(‘1′,’2′,’3’); foreach ( $pages as $parent_page ) { $args … Read more

Need wp_query to return all children and grandchildren

Ok, I found a solution. I first looped through and got all the child page ID’s, created an array, and used post_parent__in <?php $parentarray = array($parentid); $parentposts = new WP_Query( array( ‘posts_per_page’ => -1, ‘post_type’ => ‘page’, ‘post_parent’ => $parentid ) ); while ( $parentposts->have_posts() ): $parentposts->the_post(); ?> <?php $parentarray[] = get_the_id(); ?> <?php endwhile; … Read more

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