Code for pagination query_post not work
-
Good morning! (Sorry my bad English, I′m a brazilian girl ?? )
I’m with that problem in pagination when using query_post.
‘ve Tried countless codes, including:<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; ?> <?php query_posts('cat=5&showposts=5&paged=$paged'); ?> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?>
Did not work …
The only difference, I’m using query_post like this:
<?php if (is_page('ultimas-noticias')) {query_posts('category_name=Notícias');}?>
Can anyone give me a help?
The code of my index.php is:<?php get_header(); ?> <?php if (is_front_page()){include ('sidebar.php'); } if (is_page('nossa-historia')) {include ('sidebar.php'); } if (is_page('nosso-estatuto')) {include ('sidebar.php'); } if (is_home()) {include ('sidebar.php'); } if (is_home()) {query_posts('cat=-3, -6, -7, -8, -9'); } if (is_page('membros')) {include ('sidebar3.php'); } if (is_page('membros-do-staff')) {include ('sidebar3.php'); } if (is_page('membros-oficiais')) {include ('sidebar3.php'); } if (is_page('membros-em-reserva')) {include ('sidebar3.php'); } if (is_page('novos-membros')) {include ('sidebar3.php'); } if (is_page('membros-em-aprovacao')) {include ('sidebar3.php'); } if (is_page('eventos')) {include ('sidebar4.php'); } if (is_page('standards')) {include ('sidebar5.php'); } if (is_page('participe')) {include ('sidebar6.php'); } if (is_page('contato')) {include ('sidebar7.php'); } ?> <!-- Content --> <div id="content"> <?php if (is_page('ultimas-noticias')) {query_posts('category_name=Notícias');}?> <?php if (is_page('membros-do-staff')) {query_posts('category_name=Membros do Staff&order=ASC') ;}?> <?php if (is_page('membros-oficiais')) {query_posts('category_name=Membros Oficiais&order=ASC');}?> <?php if (is_page('membros-em-reserva')) {query_posts('category_name=Membros em Reserva&order=ASC');}?> <?php if (is_page('novos-membros')) {query_posts('category_name=Novos Membros&order=ASC');}?> <?php if (is_page('membros-em-aprovacao')) {query_posts('category_name=Membros em Aprova?ao&order=ASC');}?> <?php global $more; // Declare global $more (before the loop). $more = 0; // Set (inside the loop) to display all content, including text below more. the_content(); ?> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <!-- Post --> <div class="post" id="post-<?php the_ID(); ?>"> <div class="post-title"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2> <div class="post-title-info"> Por: <?php the_author() ?> em <?php the_time('d/m/Y') ?><br /> </div> <div class="clear"></div> </div> <div class="post-entry"> <?php the_content('Leia mais...'); ?> </div> <div class="post-info"> </div> </div> <!-- /Post --> <?php endwhile; ?> <!-- Navigation --> <div class="navigation"> <div class="navigation-previous"><?php next_posts_link('« Anterior') ?></div> <div class="navigation-next"><?php previous_posts_link('Próxima »') ?></div> </div> <!-- /Navigation --> <?php else : ?> <!-- Post --> <div class="post"> <div class="post-title"> <h2>Not Found</h2> </div> <div class="post-entry"> <p>Sorry, but you are looking for something that isn't here.</p> </div> </div> <!-- /Post --> <?php endif; ?> <div class="clear"></div> </div> <!-- /Content --> <?php include (TEMPLATEPATH . '/sidebar-right.php'); ?> <?php get_footer(); ?>
Thanks!!!!!!
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘Code for pagination query_post not work’ is closed to new replies.