<?php $pageNum = (get_query_var('paged')) ? get_query_var('paged') : 1;
$category = get_the_category()[0];
$paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;
wp_reset_query();
?>
<div class="container">
<div class="category_h1">
<div class="category_h1_wrap">
<img src="<?php the_field('обложка_категории', get_queried_object()) ?>" alt="<?php the_title(); ?>">
<h1 class="h1"><?= get_queried_object()->name ?><?php if(is_paged()) echo ' - страница ' .get_query_var('paged')?></h1>
</div>
</div>
</div>
<?php
$per_page = 9;
$offset_start = 12;
$offset = ( $pageNum - 1 ) * $per_page + $offset_start;
$query_ideas_4 = new WP_Query( [ 'posts_per_page' => $per_page, 'offset' => $offset, 'paged' => $paged, 'category_name' => $category->slug, 'post__not_in' => array(34432)] );
if ( have_posts() ) { ?>
<section id="ideas" class="inspiration inspiration_2 post_preview_notslides">
<div class="container">
<div class="row">
<?php
while ( $query_ideas_4->have_posts() ) {
$query_ideas_4->the_post();
if( get_field('format_class_new') == 'image-top' ) {
$format_class_new = 'post_preview_item_imgTop';
} else {
$format_class_new = '';
}
?>
<div class="col-lg-4 col-md-6">
<div class="post_preview_item <?= $format_class_new ?>">
<a href="<?php the_permalink() ?>" class="wrapImg">
<img src="<?php the_post_thumbnail_url() ?>" alt="<?php the_title(); ?>">
</a>
<div class="wrapText">
<a href="<?php the_permalink(); ?>" class="h3"><?php the_title(); ?></a>
<?php get_template_part('templates/post-info', 'bottom') ?>
</div>
</div>
</div>
<?php } wp_reset_postdata(); ?>
</div>
<div class="pagination_wrap">
<? wp_pagenavi( array( 'query' => $query_ideas_4 ) ); ?>
</div>
</div>
</section>
<?php } ?>
<?php
$posts = get_posts([
'post_type' => 'tc_events',
'numposts' => 1,
'meta_key' => 'event_date_new',
'orderby' => 'meta_value',
'order' => 'ASC'
]);
$post = array_shift($posts);
foreach( $posts as $post ):
$event_date_new = get_field('event_date_new', false, false);
$event_date_new = new DateTime($event_date_new); ?>
<label><input type='text' name="date_start" value="<?php echo $event_date_new->format('d M Y'); ?>"/></label>
<?php endforeach; ?>
["event_date_time"]=> array(1) { [0]=> string(16) "2019-09-20 08:30" }
$the_query = new WP_Query( array(
'meta_key' => 'event_date_time',
'date_query' => array(
array(
'after' => array('year' => 2019, 'month' => 12, 'day' => 2)
),
array(
'before' => array('year' => 2019, 'month' => 4, 'day' => 2)
)
)
));
function sendPusleFun() {
document.write("<script src='//static-login.sendpulse.com/apps/fc3/build/default-handler.js?155834337210'><\/srcipt>");
}
$("#consultation-form").submit(function() { //Change
var th = $(this);
$.ajax({
type: "POST",
url: "/mail.php", //Change
data: th.serialize()
}).done(function() {
sendPusleFun();
});
return false;
});
Тоже самое грубо говоря