<?php
$news_posts = get_field('news');
var_dump($news_posts);
$args = array(
'post in' => $news_posts,
'numberposts' => 5,
'post_type' => 'post',
'orderby' => 'post__in'
);
$query = new WP_Query( $args );
?>
<?php
$i=0;
foreach( $news_posts as $post ){
if($i++ == 0 ){
setup_postdata($post);
get_template_part( 'template-parts/news-item', get_post_format() );
} else {
setup_postdata($post);
get_template_part( 'template-parts/news-item', get_post_format() );
}
}
wp_reset_postdata();
?>
function showTooltip()
{
yaCounter45222606.reachGoal('callsite');
gtag('event','callsite1',{'event_category':'home1'});
var myDiv = document.getElementById('tooltip');
var myLink = document.getElementById('link');
if(myDiv.style.display == 'none')
{
myDiv.style.display = 'block';
myLink.style.display = 'none';
} else {
myDiv.style.display = 'none';
}
return false;
}
if(is_singular('news')){
//code
}
$settings = array(
'host' => 'ip or hostname', // * the ftp-server hostname
'user' => 'username', // * ftp-user
'pass' => 'password', // * ftp-password
'cdn' => 'cdn.example.com', // * This have to be a pointed domain or subdomain to the root of the uploads
'path' => '/', // - ftp-path, default is root (/). Change here and add the dir on the ftp-server,
'base' => $upload_dir['basedir'] // Basedir on local
);
<div class="group__item">
<div class="col-md-4 col-sm-6">
<div class="box">
<?php
// параметры по умолчанию
$posts = get_posts( array(
'numberposts' => 50,
'post_type' => 'group',
'publish' => true
) );
foreach( $posts as $post ){
setup_postdata($post);
?>
<?php the_post_thumbnail(); ?>
<h4 class="box__subtitle"><?php the_title(); ?></h4>
<h3 class="box__title bdb"><?php the_field('age'); ?></h3>
<div class="box__time bdb"><i class="fa fa-clock-o" aria-hidden="true"></i><?php the_field('time'); ?></div>
<div class="box__lessons bdb"><?php the_field('price'); ?></div>
<a class="bdb box__program popup" href="#program1"><i class="fa fa-book" aria-hidden="true"></i>Посмотреть программу занятий</a>
<div class="margin-big"></div>
<a href="#form" class="button popup">Хотим к вам <i class="fa fa-star" aria-hidden="true"></i></a>
</div>
</div>
<div class="hidden">
<div class="container">
<div class="row">
<form id="program1" class="box program">
<h2 class="title">Кроха</h2>
<div class="margin-big"></div>
<div class="text-center">
</div>
</form>
</div>
</div>
</div>
<?
}
?>
wp_reset_postdata(); // сброс
?>
</div>