/**
* получает массив идентификаторов текущей категории и всех дочерних
*/
function hml_get_category_gender_line( $cat_parent ){
// get_term_children() accepts integer ID only
$line = get_term_children( (int) $cat_parent, 'product_cat');
$line[] = $cat_parent;
return $line;
<?php if ( $wp_query->max_num_pages > 1 ) : ?>
$custom_query = new WP_Query( array( 'post_type' => 'event'));
function true_load_posts(){
$args = unserialize( stripslashes( $_POST['query'] ) );
$args['paged'] = $_POST['page'] + 1; // следующая страница
$args['post_status'] = 'publish';
$args['post_type'] = 'event';
query_posts( $args );
// если посты есть
if( have_posts() ) :
echo "<div>посты есть</div>";
else :
echo "<div>постов нет</div>";
endif;
die();
}