<section class="section_edit">
<div class="wrapper_edit">
<div class="container_edit">
<div class="edit_left">
<?php
// параметры по умолчанию
$my_posts = get_posts( array(
'numberposts' => 1,
'category_name' => 'reviews',
'orderby' => 'rand',
'order' => 'DESC',
'include' => array(),
'exclude' => array(),
'meta_key' => '',
'meta_value' =>'',
'post_type' => 'post',
'suppress_filters' => true, // подавление работы фильтров изменения SQL запроса
) );
global $post;
foreach( $my_posts as $post ){
setup_postdata( $post );
?>
<div class="edit_left_top">
<div class="box_edit">
<div class="box_img_edit">
<a href="<?php the_permalink() ?>">
<?php $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full' );?>
<img src="<?php echo $thumb['0'];?>" alt="" class="picture_edit">
</a>
</div>
<div class="edit_meta">
<div class="cat_block_game">
<div class="cat_game"><?php the_category(' ') ?></div>
</div>
<div class="title_block_game">
<a class="edit_left_top_title" href="<?php the_permalink() ?>"><?php trim_title_chars(60, '...'); ?></a>
<p class="edit_left_top_title_description"><?php do_excerpt(get_the_excerpt(), 20); ?></p>
</div>
<div class="data_block_game">
<div class="data_game"><?php echo get_the_date('j M. Y'); ?></div>
</div>
</div>
</div>
</div>
<?php
}
wp_reset_postdata(); // сброс
?>
<div class="edit_left_bottom">
<?php
// параметры по умолчанию
$my_posts = get_posts( array(
'numberposts' => 3,
'category_name' => '',
'orderby' => 'rand',
'order' => 'DESC',
'include' => array(),
'exclude' => array(),
'meta_key' => '',
'meta_value' =>'',
'post_type' => 'post',
'suppress_filters' => true, // подавление работы фильтров изменения SQL запроса
) );
global $post;
foreach( $my_posts as $post ){
setup_postdata( $post );
?>
<div class="edit_left_bottom_item">
<div class="edit_top_card">
<div class="edit_top_card_img">
<a href="<?php the_permalink() ?>">
<?php $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full' );?>
<img src="<?php echo $thumb['0'];?>" alt="" class="picture_bottom_edit">
</a>
</div>
<div class="meta_edit">
<div class="cat_block_edit">
<div class="cat_game"><?php the_category(' ') ?></div>
</div>
</div>
</div>
<div class="edit_bottom_card">
<a class="item_edit_meta_title_left" href="<?php the_permalink() ?>"><?php trim_title_chars(40, '...'); ?></a>
<div class="data_game"><?php echo get_the_date('j M. Y'); ?></div>
</div>
</div>
<?php
}
wp_reset_postdata(); // сброс
?>
</div>
</div>
<div class="edit_right">
<?php
// параметры по умолчанию
$my_posts = get_posts( array(
'numberposts' => 6,
'category_name' => '',
'orderby' => 'rand',
'order' => 'DESC',
'include' => array(),
'exclude' => array(),
'meta_key' => '',
'meta_value' =>'',
'post_type' => 'post',
'suppress_filters' => true, // подавление работы фильтров изменения SQL запроса
) );
global $post;
foreach( $my_posts as $post ){
setup_postdata( $post );
?>
<div class="item_edit_right">
<div class="item_edit_right_img">
<a href="<?php the_permalink() ?>">
<?php $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full' );?>
<img src="<?php echo $thumb['0'];?>" alt="" class="item_edit_right_images">
</a>
</div>
<div class="item_edit_meta">
<div class="item_edit_meta_data">
<div class="data_game"><?php echo get_the_date('j M. Y'); ?></div>
</div>
<a href="<?php the_permalink() ?>" class="item_edit_meta_title"><?php trim_title_chars(46, '...'); ?></a>
</div>
</div>
<?php
}
wp_reset_postdata(); // сброс
?>
</div>
</div>
</div>
</section>
'include' => array(), - пустой
'exclude' => array(), - пустой
'order' => 'DESC', - по дефолту
'meta_key' => '', - пустой
'meta_value' =>'', - пустой
$my_posts = get_posts( array(
'numberposts' => 1,
'category_name' => 'reviews',
'orderby' => 'rand',
'suppress_filters' => true,
) );
$my_posts = get_posts( array(
'numberposts' => 3,
'category_name' => '',
'orderby' => 'rand',
'order' => 'DESC',
'include' => array(),
'exclude' => array(),
'meta_key' => '',
'meta_value' =>'',
'post_type' => 'post',
'suppress_filters' => true, // подавление работы фильтров изменения SQL запроса
) );
$my_posts = get_posts( array(
'numberposts' => 6,
'category_name' => '',
'orderby' => 'rand',
'order' => 'DESC',
'include' => array(),
'exclude' => array(),
'meta_key' => '',
'meta_value' =>'',
'post_type' => 'post',
'suppress_filters' => true, // подавление работы фильтров изменения SQL запроса
) );
$my_posts = get_posts( array(
'numberposts' => 9,
'orderby' => 'rand',
'post_type' => 'post',
'suppress_filters' => true, // подавление работы фильтров изменения SQL запроса
) );
$my_posts = get_posts( array(
'numberposts' => 9,
'orderby' => 'rand',
'post_type' => 'post',
'suppress_filters' => true,
) );
for ($i = 0; $i < 3 $i++) {
}
for ($i = 3; $i < count($my_posts); $i++) {
}