Hello, I would like your help with the following problem, I would like to know how I can count WordPress posts, using the settings imposed in the code below, to count only posts with meta_key
, tipo_de_item
value Novo
, with post parameter publish
.
<?php
/*
Template Name: DT - Revistas
*/
get_header();
doo_glossary('listagem');
global $user_ID;
$dt = isset( $_GET['get'] ) ? $_GET['get'] : null;
$admin = isset( $_GET['admin'] ) ? $_GET['admin'] : null;
echo '<div class="module"><div class="content">';
get_template_part('inc/parts/modules/featured-post-tvshows');
echo '<header><h1>'. __d('Novas'). '</h1></header>';
echo '<div id="archive-content" class="animation-2 items">';
// Ordenar em ordem alfabetica
global $wp_query;
$pages = $wp_query->max_num_pages;
query_posts(array(
'posts_per_page' => $pages,
'paged' => $paged,
'post_type' => array('revista'),
'meta_key' => 'tipo_de_item',
'meta_value' => 'Novo',
'order' => 'ASC',
'orderby' => 'title'
));
if (have_posts()) {
while (have_posts()) {
the_post();
get_template_part('inc/parts/item');
}
}
echo '</div>';
if ( function_exists("pagination") ) {
pagination();
}
echo '</div>';
get_template_part('inc/parts/sidebar');
echo '</div>';
get_footer();