Suporte » Plugins » Page Navi não troca de página

  • Resolvido felipe_araujo1

    (@felipe_araujo1)


    Galera estou começando agora a aprender o wordpress e estou com o seguinte problema instalei o plugin pagenavi e o mesmo está dividindo as páginas corretamente, porém quando clico em outras páginas ele abre a mesma página principal dos posts mais recentes, como faço para corrigir isso ?
    segue código

    <!-- CONTAINER_12 -->
    <div class="container_12">
    
    <div class="grid_8" id="content">
    <?php query_posts('showposts=4');?>
    <?php if (have_posts()): while (have_posts()) : the_post();?>
    
    <h1><?php the_title();?></h1>
    <small><?php the_time('j M Y');?> | <?php if(function_exists('the_views')){the_views();}?> | <?php comments_popup_link('0 comentário','1 comentário','% Comentários');?></small>
    <p><?php the_content(__('Leia mais'));?></p>
    <?php endwhile; else:?>
    <?php endif;?>
    
    <div id="relacionados">
    		 <?php if(function_exists('echo_ald_crp')) echo_ald_crp(); ?>
    
    	 <?php comments_template(); ?>
    
     </div>
    
    <?php if(function_exists('wp_pagenavi')) {wp_pagenavi();}?>
    </div>
    
    <div class="grid_4 omega" id="rightsidebar">
    <div id="rsidebar">
    <?php get_sidebar(); ?>
    </div>
    </div>
    <div class="clear"></div>
    </div><!-- FIM CONTAINER_12 -->
Visualizando 2 respostas - 1 até 2 (de um total de 2)
  • Criador do tópico felipe_araujo1

    (@felipe_araujo1)

    Consegui resolver com o seguinte código:

    <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; ?>
    
    <?php query_posts("showposts=4&paged=$paged"); ?>
    
    <?php if (have_posts()): while (have_posts()) : the_post();?> <!-- Início Loop do wodpress -->
    
    <h1><?php the_title();?></h1><!-- Permalink chama o link do post completo e The_title pega o titulo -->
    <small><?php the_time('j M Y');?> | <?php if(function_exists('the_views')){the_views();}?> | <?php comments_popup_link('0 comentário','1 comentário','% Comentários');?></small>
    <p><?php the_content(__('Leia mais'));?></p>
    <?php endwhile; else:?>
    <?php endif;?>

    Fica a dica aí se alguem precisar.

    Boa tarde,
    já olhei muitos tópicos e não consigo resolver este problema, alguém pode me ajudar?

    <?php
    	$paged = (get_query_var("paged")) ? get_query_var("paged") : 1;
    	$args = array(
    		"post_type" => "cliente",
    		"posts_per_page" => "4",
    		"paged" => $paged
    	);
    
    	$wp_query = new WP_Query( $args );
    
    		if ( $wp_query->have_posts() ) {
    
    			while ( $wp_query->have_posts() ) : $wp_query->the_post();?>
    
    				<div class="list">
    					<!--<h3><a href="<?php //the_permalink(); ?>" title="<?php //the_title(); ?>"><?php //the_title(); ?></a></h3>-->
    					<?php the_post_thumbnail("thumbnail");?>
    				</div><!--list-->
    
    			<?php endwhile; // end of the loop.?>
    		<div id="paginate">
    			<?php wp_pagenavi( array( "query" => $wp_query ) );}?>
    		</div>
Visualizando 2 respostas - 1 até 2 (de um total de 2)
  • O tópico ‘Page Navi não troca de página’ está fechado para novas respostas.