i have list of posts, list of Categories, Parent/ Child
i also use custom-taxonomy-order-ne plugin to order my categories
in my code the query work find (hide empty, remove duplicates, count the number of posts,) but the problem is i need to display categories hierarchical
i need to sort my query
Parent A
– Child 1
– Post
– Post
– Child 2
– Post
– Post
Parent B
– Child 3
– Post
– Post
– Child 5
– Post
– Post
*, html, div#content {
direction: rtl !important;
}
?????
???????
??? ????????????
????? ??????
???????
??? ????????????????
????? ????
???????
?????
????
?????
????
?????
‘term_order’,
‘order’ => ‘DESC’
);
$terms = get_terms($taxonomy,$term_args);
if ($terms) {
$counter = 1;
$total_invitations=0;
$total_invitees=0;
foreach( $terms as $term ) {
$args=array(
‘post__not_in’ => $do_not_duplicate,
‘connected_type’ => ‘post_to_event’,
‘connected_items’ => get_queried_object(),
“$param_type” => array($term->term_id),
‘nopaging’ => true,
‘post_type’ => ‘post’,
‘post_status’ => ‘publish,draft’,
‘posts_per_page’ => -1,
‘caller_get_posts’=> 1
);
$my_query = null;
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
$cat_invitations=$my_query->found_posts;
$cat_invitees=0;
$do_not_duplicate[] = get_the_ID();
?>
name;?>
have_posts() ) {
while ($my_query->have_posts()) :
$my_query->the_post();
$post_id = get_the_ID();
if (in_array($post_id, $do_not_duplicate)) {
continue; // We’ve already seen this post ID, so skip the rest of the loop
}
if (p2p_get_meta(get_post()->p2p_id, ‘couples’, true) == ‘1’) $cat_invitees+= 2;
else $cat_invitees++;
$do_not_duplicate[] = $post_id;
?>
ID, ‘ecpt_position’, true); ?>
p2p_id, ‘invitation_date’, true ); ?>
ID, ‘ecpt_address’, true); ?>
p2p_id, ‘confirmation’, true ); ?>
p2p_id, ‘comments’, true ); ?>
p2p_id, ‘table’, true ); ?>
p2p_id, ‘attend’, true ); ?>
ID, ‘ecpt_email’, true); ?>
ID, ‘ecpt_phone’, true); ?> ID, ‘ecpt_ext’, true); ?>
ID, ‘ecpt_mobile’, true); ?>
?????? ??? ???????
?????? ??? ?????????