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>
function wp_get_productcat_postcount($id) {
//return $count;
$args = array(
'post_type' => 'product', //post type, I used 'product'
'post_status' => 'publish', // just tried to find all published post
'posts_per_page' => -1, //show all
'tax_query' => array(
'relation' => 'AND',
array(
'taxonomy' => 'product_cat', //taxonomy name here, I used 'product_cat'
'field' => 'id',
'terms' => array( $id )
)
)
);
$query = new WP_Query( $args);
/*
echo '<pre>';
print_r($query->post_count);
echo '</pre>';
*/
return (int)$query->post_count;
}