Created your type of materials in wordpresse. First, they can be given three formats: standard, video and image. Secondly, still set the time periods to which they relate.

It is necessary that the records were sorted, first of all, by these periods. And within each period were displayed in groups depending on the format: video, image and standard.

So far I have this:

$args = array( 'post_type' => 'otzivi', 'publish' => true, 'paged' => get_query_var('paged'), ); query_posts($args); if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <div class="col-xs-10 col-sm-10 col-md-7"> <h1><? the_title(); ?></h1> <?php if (function_exists('dimox_breadcrumbs')) dimox_breadcrumbs(); ?> <? the_content(); ?> <? include 'share.php'; ?> </div> <? endwhile; endif; ?> 

It is displayed accordingly just by the list (plus, as I understood it better to use get_posts ();)

In functions.php I create a taxonomy for a period of time:

 add_action( 'init', 'create_book_taxonomies', 0 ); function create_book_taxonomies(){ $labels = array( 'name' => _x( 'Года', 'taxonomy general name' ), 'singular_name' => _x( 'Год', 'taxonomy singular name' ), 'search_items' => __( 'Поиск года' ), 'all_items' => __( 'Все года' ), 'edit_item' => __( 'Редактировать год' ), 'update_item' => __( 'Обновить год' ), 'add_new_item' => __( 'Добавить год' ), 'new_item_name' => __( 'Новый год' ), 'menu_name' => __( 'Период времени' ), ); register_taxonomy('tax_otzivi', array('otzivi'), array( 'hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'query_var' => true, )); 

}

Adding a record format type:

 add_theme_support( 'post-formats', array( 'image', 'video' ) ); 

And in the code where I register this material I add support for 'post-formats'

  • Show the code that you assign the format and time period to your feedback. - KAGG Design
  • @KAGGDesign added to the description of the issue - Alexander Timofeev

0