Затык в том, что события самого календаря идут отдельной таксономией вне потока вывода query_posts() и никак не связаны с остальными постами, не знаю как можно было бы b[ совместить.можно воспользоваться крючком
pre_get_posts
add_action('pre_get_posts', 'get_posts_search_filter');
function get_posts_search_filter( $query ){
if ( ! is_admin() && $query->is_main_query() && $query->is_search ) {
$query->set('post_type', array('post', 'movie') );
}
}
add_action('pre_get_posts', 'filter');
function filter($query)
{
if (!is_admin() && $query->is_main_query() && !is_single() &&
((isset($_GET['pa_class']) || isset($_GET['pa_size']) || isset($_GET['pa_material']))
)
) {
if (is_woocommerce()) {
if ((isset($_GET['pa_class']) && !empty($_GET['pa_class'])) ||
(isset($_GET['pa_size']) && !empty($_GET['pa_size'])) ||
(isset($_GET['pa_color']) && !empty($_GET['pa_color'])) ||
(isset($_GET['pa_material']) && !empty($_GET['pa_material']))
) {
if ((isset($_GET['pa_class']) && !empty($_GET['pa_class']))) {
$tax[] = array(
'taxonomy' => 'pa_class',
'field' => 'slug',
'terms' => $_GET['pa_class']
);
}
if ((isset($_GET['pa_color']) && !empty($_GET['pa_color']))) {
$tax[] = array(
'taxonomy' => 'pa_color',
'field' => 'slug',
'terms' => $_GET['pa_color']
);
}
if ((isset($_GET['pa_size']) && !empty($_GET['pa_size']))) {
$tax[] = array(
'taxonomy' => 'pa_size',
'field' => 'slug',
'terms' => $_GET['pa_size']
);
}
if ((isset($_GET['pa_material']) && !empty($_GET['pa_material']))) {
$tax[] = array(
'taxonomy' => 'pa_material',
'field' => 'slug',
'terms' => $_GET['pa_material']
);
}
$query->set('tax_query', $tax);
}
}
} elseif (is_search()) {
$query->set('post_type', 'product');
}
}
$args = array(
'post_parent' => 740,
'order' => 'DESC',
'post_mime_type' => 'image',
'post_type' => 'attachment',
'numberposts' => 1,
'orderby' => 'ID'
);
$attachments = get_children( $args );
if( $attachments ){
foreach( $attachments as $attachment ){
$image_src = wp_get_attachment_image_src( $attachment->ID, 'thumbnail' )[0] ?: wp_get_attachment_image_src( $attachment->ID, 'full' )[0];
$image_desc = $attachment->post_content ?: $attachment->post_title;
echo '<img src="'. $image_src .'" alt="'. esc_attr( $image_desc ) .'" class="current">';
}
}
add_ahortcode('shortcode_name','my_shortcode_function');
function my_shortcode_function($attr) {
ob_start();
$parametri = array(
'post_type' => 'post',
'post_status' => 'publish',
'posts_per_page' => -1,
'caller_get_posts' => 1
);
$moi_zapros = null;
$moi_zapros = new WP_Query($parametri);
if ($moi_zapros->have_posts()):
print '<ol>';
while ($moi_zapros->have_posts()) : $moi_zapros->the_post();
$idt=get_the_ID();
$trip=get_post_meta($idt,"trip", true);?>
<li class="map"><a href="<?php the_permalink() ?>" title="Постоянный линк для:<?php the_title_attribute(); ?>" target="_blank"><?php the_title(); if ($trip) {echo " ", $trip, ". День ",get_post_meta($idt,"day", true), ". ";}?> (<?php print get_comments_number();?>)</a></li>
<?php
endwhile;
print '</ol>';
endif;
wp_reset_query();
return ob_get_clean();
}
$args = array(
'posts_per_page' => -1,
'category' => $categoryId,
'orderby' =>'meta_value_num',
'order' => 'ASC',
'meta_key' => 'ORDER',
'post_type' => 'post',
);
$posts = get_posts($args);