Ни как не могу понять что не так...
Прошу помощи коллективного разума.
Есть такой код:
*************
<div style="border:2px dashed; min-height:30px; margin: 10px;">
<p>Номер поста: <?php the_ID(); ?></p>
<?php
$stati_children = new WP_Query(array(
//'taxonomy' => 'aaaa',
'post_type' => 'post',
'post_parent' => get_the_ID(),
//'post_parent_in' => 923,
'posts_per_page' => 5,
)
);
if($stati_children->have_posts()) :
while($stati_children->have_posts()): $stati_children->the_post();
echo '<h2>'.get_the_title().'</h2>';
echo '<p>'.get_the_excerpt().'</p>';
//echo '<p><a href="'.get_the_permalink().'">'.Подробнее.'</a></p>';
endwhile;
endif; wp_reset_query();
?>
<?php print_r($stati_children);?>
</div>
****
В файле функции есть (часть кода в примере):
add_action( 'init', 'true_register_aaaa' ); // Использовать функцию только внутри хука init
function true_register_aaaa() {
$labels = array(
'name' => 'Бла бла',
....
'rewrite' => array( 'slug' => 'taksanomiya' ),
.....
register_post_type('aaaa',$args);
.....
add_action('init', 'create_aaaa_taxonomy');
function create_aaaa_taxonomy(){
// список параметров: http://wp-kama.ru/function/get_taxonomy_labels
register_taxonomy('test', array('new_test'), array(
.....
'rewrite' => array( 'slug' => '' ),
Есть следующая страктура:
Родитель
- дочка 1
- дочка 2
- и т.д.
Цель:
вывод на странице родителя в виде списка всех её дочек.
Почему-то не получается (((
вывод такой:Номер поста: 923
WP_Query Object
(
[query] => Array
(
[post_type] => post
[post_parent] => 923
[posts_per_page] => 5
)
[query_vars] => Array
(
[post_type] => post
[post_parent] => 923
[posts_per_page] => 5
[error] =>
[m] =>
[p] => 0
[subpost] =>
[subpost_id] =>
[attachment] =>
[attachment_id] => 0
[name] =>
[pagename] =>
[page_id] => 0
[second] =>
[minute] =>
[hour] =>
[day] => 0
[monthnum] => 0
[year] => 0
[w] => 0
[category_name] =>
[tag] =>
[cat] =>
[tag_id] =>
[author] =>
[author_name] =>
[feed] =>
[tb] =>
[paged] => 0
[meta_key] =>
[meta_value] =>
[preview] =>
[s] =>
[sentence] =>
[title] =>
[fields] =>
[menu_order] =>
[embed] =>
[category__in] => Array
(
)
[category__not_in] => Array
(
)
[category__and] => Array
(
)
[post__in] => Array
(
)
[post__not_in] => Array
(
)
[post_name__in] => Array
(
)
[tag__in] => Array
(
)
[tag__not_in] => Array
(
)
[tag__and] => Array
(
)
[tag_slug__in] => Array
(
)
[tag_slug__and] => Array
(
)
[post_parent__in] => Array
(
)
[post_parent__not_in] => Array
(
)
[author__in] => Array
(
)
[author__not_in] => Array
(
)
[ignore_sticky_posts] =>
[suppress_filters] =>
[cache_results] => 1
[update_post_term_cache] => 1
[lazy_load_term_meta] => 1
[update_post_meta_cache] => 1
[nopaging] =>
[comments_per_page] => 50
[no_found_rows] =>
[order] => DESC
)
[tax_query] => WP_Tax_Query Object
(
[queries] => Array
(
)
[relation] => AND
[table_aliases:protected] => Array
(
)
[queried_terms] => Array
(
)
[primary_table] => wp_posts
[primary_id_column] => ID
)
[meta_query] => WP_Meta_Query Object
(
[queries] => Array
(
)
[relation] =>
[meta_table] =>
[meta_id_column] =>
[primary_table] =>
[primary_id_column] =>
[table_aliases:protected] => Array
(
)
[clauses:protected] => Array
(
)
[has_or_relation:protected] =>
)
[date_query] =>
[request] => SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_parent = 923 AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish') ORDER BY wp_posts.post_date DESC LIMIT 0, 5
[posts] => Array
(
)
[post_count] => 0
[current_post] => -1
[in_the_loop] =>
[comment_count] => 0
[current_comment] => -1
[found_posts] => 0
[max_num_pages] => 0
[max_num_comment_pages] => 0
[is_single] =>
[is_preview] =>
[is_page] =>
[is_archive] =>
[is_date] =>
[is_year] =>
[is_month] =>
[is_day] =>
[is_time] =>
[is_author] =>
[is_category] =>
[is_tag] =>
[is_tax] =>
[is_search] =>
[is_feed] =>
[is_comment_feed] =>
[is_trackback] =>
[is_home] => 1
[is_privacy_policy] =>
[is_404] =>
[is_embed] =>
[is_paged] =>
[is_admin] =>
[is_attachment] =>
[is_singular] =>
[is_robots] =>
[is_posts_page] =>
[is_post_type_archive] =>
[query_vars_hash:WP_Query:private] => e8374e1135c7865459ad0d4ab50d25ce
[query_vars_changed:WP_Query:private] =>
[thumbnails_cached] =>
[stopwords:WP_Query:private] =>
[compat_fields:WP_Query:private] => Array
(
[0] => query_vars_hash
[1] => query_vars_changed
)
[compat_methods:WP_Query:private] => Array
(
[0] => init_query_flags
[1] => parse_tax_query
)
)