/*
Template name:NOVOSTI
*/
<?php wp_set_password( $password, $user_id ) ?>
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
wp_pagenavi( array( 'query' => $wp_query ) );
the_posts_navigation();
<div class="items">
<div class="item">Новость 1</div>
<div class="item">Новость 2</div>
<div class="item">Новость 3</div>
<div class="item">Новость 4</div>
<div class="item">Новость 5</div>
</div>
.items .item:nth-child(1){
color:red;//перечисляем свойства
}
.items .item:nth-child(3){
color:blue;//перечисляем свойства
}
.items .item:nth-child(2n){
color:blue;//перечисляем свойства
}
if (is_page('reviews')) {//для страниц
//вызов модуля
}
if (is_single('reviews')) {//для записей
//вызов модуля
}
$args = array(
'post_type' => 'Мой тип',
'posts_per_page' => 10,//количество записей которые надо вывести
'date_query' => array(array('after' => 'April 18th, 2016','before' => 'April 25th, 2016', )
);
$query = new WP_Query( $args );
while ( $queryt->have_posts() ) {
$query->the_post();
echo get_the_title();//Выводим сам пост
}
$new_post_date = current_time('mysql');
$new_post_date_gmt = get_gmt_from_date($new_post_date);
$args = array(
'comment_status' => $post->comment_status,
'ping_status' => $post->ping_status,
'post_author' => $new_post_author,
'post_content' => $post->post_content,
'post_excerpt' => $post->post_excerpt,
'post_name' => $post->post_name,
'post_parent' => $post->post_parent,
'post_password' => $post->post_password,
'post_status' => 'publish', // черновик, если хотите сразу публиковать - замените на publish
'post_title' => $post->post_title,
'post_type' => $post->post_type,
'to_ping' => $post->to_ping,
'menu_order' => $post->menu_order,
'post_date' => $new_post_date,
'post_date_gmt' => $new_post_date_gmt,
'post_modified' => $new_post_date,
'post_modified_gmt' => $new_post_date_gmt,
);