0
Ola would like the help of you for the following problem, I would like to know how I can perform the count of Wordpress posts, using the settings imposed in the code below, to perform the count only posts with meta_key
, tipo_de_item
value Novo
, with posting 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();
Thank you Reply however, I forgot to mention that the count should be able to calculate all existing items, in which case the function you passed only counts the number of items per page. I need in case you count all existing items with these parameters contained in the database.
– Ani
You could try switching from post_count to found_posts ?
– JassRiver
Can you sort my answer? xD just click the arrow up s2 I’d appreciate it if you could. haha xD And you’re using dooplay or some Doo theme, right? xD
– JassRiver
Yes, you would tell me how can I activate the Letter mode ? I asked a question about this no longer obitive answer yet.
– Ani
Is that your questions are not very clear face kkkkkk But I know inform yes, I will answer there on topic
– JassRiver
I’m sorry, and I don’t know the technical terms.
– Ani