Hi Thanks for taking your time to read I hope it makes sense
I have a shortcode that I want to display all the children granchidren of page ID10 but instead it display all pages can someone help please? Here is my shortcode:
/* Digital query display latest 3 pages that is custom field extramenu with value (portfoliomenu) and is child page of ID 10 */
function megamenu_digital_portfolio_function($atts) {
extract(shortcode_atts(array(
'posts' => 2,
), $atts));
$return_string = '<div class="three-columns">';
query_posts(array(
'sort_order' => 'asc',
'sort_column' => 'post_title',
'hierarchical' => 1,
'exclude' => '',
'include' => '',
'meta_key' => '',
'meta_value' => '',
'authors' => '',
'child_of' => 0,
'parent' => -1,
'exclude_tree' => '',
'number' => '',
'offset' => 0,
'post_type' => 'page',
'meta_key' => 'extra_menu',
'meta_value' => 'portfoliomenu',
'showposts' => $posts));
if (have_posts()) :
while (have_posts()) : the_post();
$return_string .= '
<div class="column portfolio megamenu-digital-news">
<div class="column-inner">
<a href="'.get_permalink().'">
<div class="megamenu-news-image">'.get_the_post_thumbnail().'</div>
<p class="megamenu-news-title">'.short_title('...', 10).'</p>
<p class="megamenu-news-teaser-text">'.get_the_popular_excerpt().'</p>
<p class="read-more">Read More</p>
</a>
</div>
</div>';
endwhile;
endif;
$return_string .= '</div>';
$return_string .= '<div class="digital-news-footer"><p class="read-more"><a href="#">View All Digital News</a></p></div>';
wp_reset_query();
return $return_string;
}