Suporte » Temas » Navegação não funciona query_posts

  • Resolvido victorl5

    (@victorl5)


    Olá galera , recentemente estava editando um tema porém o tema não possuia nenhuma interface de navegação para avançar as paginas assim inseri uma , porém a mesma não funcionou ( já havia modificado o template bastante ), a navegação é exibida normalmente as paginas passam mas continua sempre as mesmas postagens

    Meu Código:

    <?php
    query_posts('showposts=1' );if (have_posts()) : while (have_posts()) : the_post(); $category = get_the_category();?>
    <div <?php post_class(); ?>>
    
    """TODA A POSTAGENS DIVs e ETC AQUI """
    
    <ul class="cat-posts">
    <?php
    $posted = get_posts( "category=" . $category[0]->cat_ID );
    if( $posted ) :foreach( $posted as $post ) : setup_postdata( $posted );
    ?>
    										<li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a><span><?php the_time( ' F j, Y' ) ?></span></li>
    										<?php endforeach;								endif;?>
    
    <li class="view-more"><a href="<?php echo get_category_link( $category[0]->cat_ID ); ?>" class="view-more">View More &raquo;</a></li>
    									</ul>
    
    """" ALGUMAS DIVs SÃO FECHADAS AQUI """"""
    
    <?php endwhile; endif; ?>
    
    <?php
    					query_posts('showposts=2&offset=1' );
    if (have_posts()) : $counter = 0;
    while (have_posts()) : the_post(); $category = get_the_category();
    if( $counter % 2 == 0 )$end = "";else $end = "last";
    ?>
    
    <div <?php post_class( 'single ' . $end ); ?>>
    
    """ mais uma postagem com layout diferente da primeira ( Divs e etc) """"
    <article id="spacer">
    <?php
    $counter++;
    endwhile;
    endif; ?>
    </article>
    <div id="pagination">
         <div id="pagination-previous" class="button"><?php previous_posts_link('previous'); ?></div>
         <div id="pagination-next" class="button"><?php next_posts_link('next'); ?></div>
    </div>

    desde já agradeço pela ajuda 🙂

Visualizando 2 respostas - 1 até 2 (de um total de 2)
Visualizando 2 respostas - 1 até 2 (de um total de 2)
  • O tópico ‘Navegação não funciona query_posts’ está fechado para novas respostas.