How to bring custom materials plus given its taxonomies (wordpress)?

Created his own type of materials WordPress'e. First, they can be given in three formats: standard, video and image. Secondly, to specify time periods to which they relate.

You need to have the record sorted in the first place, for those periods. But within each period of the output 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; ?>

Displays a correspondingly simple list (plus, as I understand it is better to use get_posts(); )

In functions.php create a taxonomy for a period of time:
add_action( 'init', 'create_book_taxonomies', 0 );


create_book_taxonomies function(){

$labels = array(
 'name' => _x( 'Year', 'taxonomy general name' ),
 'singular_name' => _x( 'Year', 'taxonomy singular name' ),
 'search_items' => __( 'Search year' ),
 'all_items' => __( 'All years' ),
 'edit_item' => __( 'Edit year' ),
 'update_item' => __( 'Update year' ),
 'add_new_item' => __( 'Add year' ),
 'new_item_name' => __( 'New year' ),
 'menu_name' => __( 'time Period' ),
);


register_taxonomy('tax_otzivi', array('otzivi'), array(
 'hierarchical' => true,
 'labels' => $labels,
 'show_ui' => true,
 'query_var' => true,

));
}


Add the type of recording format:

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


And in the code where register this material adds support for 'post-formats'
June 27th 19 at 14:57

Find more questions by tags WordPress