How to finish this loop?

I think that the very helpful user gave you a wrong answer. Here a example which I think is better: //The ID of the parent page, for example 4. Change to the correct ID. //For example, if you are in the page loop, you can use get_the_ID() to get ID of current page $parent_id = … Read more

Firing page_publish where page is child page

The publish_page action is listed as deprecated. You can use the ‘transition_post_status’ hook to check if a page was published. function publish_page_interception( $new_status, $old_status, $post ) { if ( ($new_status != $old_status) && ($post->post_status == ‘publish’) && ($post->post_type == ‘page’) ) { if($post->post_parent > 0) { //do stuff } } } add_action( ‘transition_post_status’, ‘publish_page_interception’, 10, … Read more

Display Tags of Child Pages

I modified my code based on this posting’s answer, and the page displays everything I want now. <div id=”masonry-loop” class = “group”> <?php global $post; $child_pages_query_args = array( ‘post_type’ => ‘page’, ‘post_parent’ => $post->ID, ); $child_pages = new WP_Query( $child_pages_query_args ); if ( $child_pages->have_posts() ) : while ( $child_pages->have_posts() ) : $child_pages->the_post(); ?> <?php $images … Read more

Link to most recent child page

I found a solution! This is what I did: <?php query_posts(array(‘orderby’ => ‘menu_order’, ‘order’ => ‘ASC’, ‘posts_per_page’ => 1, ‘post_parent’ => $page_id, ‘post_type’ => ‘page’)); while (have_posts()) { the_post(); ?> <a href=”https://wordpress.stackexchange.com/questions/158490/<?php the_permalink(); ?>”>Link</a> <?php } ?> <?php wp_reset_query() ?> It makes a loop of sub-pages to a particular page and limits it to only … Read more

Elegant way to signify inheritance and relationship between posts

Using the Posts 2 Posts Module which is still being developed just no support is being offered except through the git fork. How to use it. function my_connection_types() { p2p_register_connection_type( array( ‘name’ => ‘posts_to_pages’, ‘from’ => ‘post_type_1’, ‘to’ => ‘post_type_2’, ‘cardinality’ => ‘one-to-many’ ) ); } add_action( ‘p2p_init’, ‘my_connection_types’ ); The above example will create … Read more

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