<?php
/*
Template Name: Closet
*/
?>
<?php get_header(); ?>
<nav class="main-navigation">
<? wp_nav_menu(array(‘menu’ => ‘top-menu’, ‘menu_class’ => ‘top-menu’)); ?>
</nav>
<section>
<div class="main-heading"><h1><?php the_title(); ?></h1></div>
<?php
$time = current_time( ‘timestamp’ ); // Get current unix timestamp
// Set up custom query with meta_query to compare event start date with today’s date
$args = array (
‘post_type’ => ‘post’, // your event post type slug
‘post_status’ => ‘publish’, // only show published events
‘orderby’ => ‘meta_value’, // order by date
‘meta_key’ => ‘beginning_date’, // your ACF Date & Time Picker field
‘meta_value’ => $time, // Use the current time from above
‘meta_compare’ => ‘>=’, // Compare today’s datetime with our event datetime
‘order’ => ‘DESC’, // Show earlier events first
‘posts_per_page’ => 100,
);
$query = new WP_Query( $args );
if ( $query->have_posts() ) :
echo ‘<div class="main-conference">’;
echo ‘<ul>’;
while ( $query->have_posts() ) : $query->the_post(); // Start loop
echo ‘<li><div class="title-main-conference"><a href="’ . get_the_permalink(). ‘" rel="bookmark">’ . $subject = get_the_title() . ”;
echo ‘</a></div>’;
echo ‘<div class="thumbnail-conference"><a href="’ . get_the_permalink() . ‘" rel="bookmark">’;
echo the_post_thumbnail(‘full’);
echo ‘<div class="under-conference">’;
echo ‘<div class="registration"><a href="#contact_form_pop" class="fancybox" dataTitle ="’;
echo $subject;
echo ‘"><img src="’ . get_template_directory_uri() . ‘/images/registration.png"></a>’;
echo ‘<div style="display:none" class="fancybox-hidden">’;
echo ‘<div id="contact_form_pop">’ . do_shortcode(‘[contact-form-7 id="65"]’) . ‘</div> ‘;
echo ‘</div><div class="regtext">’;
echo _e(‘Регистрация’,’catskot’);
echo ‘</div></div>’;
echo ‘<div class="date-of-conference">’;
echo the_field(‘date_of_conference’);
echo ‘<br/>’;
echo the_field(‘place_of_conference’);
echo ‘</div>’;
echo ‘<div class="request"><a href="#contact_form_pop1" class="fancybox" dataTitle ="’;
echo $subject;
echo ‘"><img src="’ . get_template_directory_uri() . ‘/images/request.png"></a>’;
echo ‘<div style="display:none" class="fancybox-hidden">’;
echo ‘<div id="contact_form_pop1">’ . do_shortcode(‘[contact-form-7 id="66"]’) . ‘</div></div>’;
echo ‘<div class="reqtext">’;
echo _e( ‘Программа’,’catskot’);
echo ‘</div></div>’;
echo ‘</div>’;
echo ‘</a></div>’;
// Your custom loop code here
wp_reset_postdata();
endwhile;
echo ‘</ul>’;
echo ‘</div>’;
endif;
?>
</section>
<?php get_footer(); ?>
<script>
/*the jQuery code*/
jQuery(document).ready(function($){
$(‘.fancybox’).click(function(){
var title = $(this).attr(‘dataTitle’);
$(".your-subject input").val(title);
});
});
</script>
Уже пробовал сделать вывод постов меньше, не помогает…