Problema de paginacion en Blog: Saltos a primera pagina

  • Autor Autor BHB36
  • Fecha de inicio Fecha de inicio
B

BHB36

Préstamo
Gamma
Buenas betas
Tengo un problema con la paginacion de mi web, tengo mas de 5 entradas y por pagina me muestra solo 5 y al momento de cambiar de la pagina 1 a la 2 en la parte de abajo me vuelve a saltar a la primera pagina, hay solucion a esto.... el problema lo pueden ver aqui Home - Grubber
 
Revisa que el numero de entradas de la pagina principal sea de 10. Eso lo puedes ver desde ajustes>lectura.
Estas usando algun plugin de paginacion, ej., wp-pagenavi?
 
En los loops del theme

buscas:

Insertar CODE, HTML o PHP:
query_post

Y agregas antes:

Insertar CODE, HTML o PHP:
if ( get_query_var('paged') ) { $paged = get_query_var('paged'); }
elseif ( get_query_var('page') ) { $paged = get_query_var('page'); }
else { $paged = 1; }

buscas:

Insertar CODE, HTML o PHP:
query_post

Y agregas dentro de sus "()"

Insertar CODE, HTML o PHP:
'paged' => $paged

Si es posible, deja los loops en un post :encouragement:
 
[MENTION=18661]Lopezito[/MENTION]
Insertar CODE, HTML o PHP:
<?php 
$format =  get_post_format($post->ID); 
if($format == '') $format = 'standard';
$format_link = get_post_format_link($format);
if($format=='standard')
	$format_link = get_permalink();
if($format!='standard')
	$all_format_title = 'title="View all '.$format.' posts"';
else $all_format_title = 'title="Read the full article"';
?>
<article <?php post_class(); ?>   id="post-<?php the_ID(); ?>">
<?php if(get_option('mp_post_format_icons')!='true'): ?>
<a href="<?php echo $format_link; ?>" class="post-format-icon <?php echo $format; ?>" <?php echo $all_format_title; ?>></a>
<?php endif; ?>

<?php
$tags = get_the_tag_list('<span class="blog-link first" style="margin-bottom:15px"><span class="icon tags"></span>Tags: ',', ','</span>');
?>					
	<?php

		if ( has_post_format( 'aside' )) {
			musicpro_get_post_links();
			the_content(); echo $tags;
			if(get_option('mp_sharebuttons_post_page')==true):
			mp_shareButtons(get_permalink($post->ID) , get_the_title($post->ID), false );
			endif; 
		}

		elseif ( has_post_format( 'link' )) {
			 if(get_post_meta($post->ID, '_format_link_url', true)!=''){ 
				$link = get_post_meta($post->ID, '_format_link_url', true);
				}else{
				$link = '';	
				}
			?>
			<h2 class="entry-title">
			<a href="<?php echo $link; ?>" title="Follow this link">
			[link] <?php the_title(); ?>
			</a> 
			</h2>
			<p>
				<span class="cite"><?php echo $link; ?></span>
			</p>
			<?php musicpro_get_post_links(); ?>
			<?php the_excerpt(); echo $tags; 
			if(get_option('mp_sharebuttons_post_page')==true):
			mp_shareButtons(get_permalink($post->ID) , get_the_title($post->ID), false );
			endif; 
			
		}

		elseif ( has_post_format( 'quote' )) {
			?><h2 class="entry-title"><a title="Read the full article" href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
			<?php
			musicpro_get_post_links();
			?>
			<div class="featured-quote">
				<blockquote>
					<p><?php echo get_post_meta($post->ID, '_format_quote_text', true); ?></p>
					<?php if(get_post_meta($post->ID, '_format_quote_source_name', true)!=''): ?>
					<small><?php if(get_post_meta($post->ID, '_format_quote_source_url', true)!=''): ?><a href="<?php echo get_post_meta($post->ID, '_format_quote_source_url', true); ?>" target="_blank"><?php endif; ?><?php echo get_post_meta($post->ID, '_format_quote_source_name', true); ?><?php if(get_post_meta($post->ID, '_format_quote_source_url', true)!=''): ?></a><?php endif; ?></small>
					<?php endif; ?>
				</blockquote>
			</div>
			<?php the_excerpt(); echo $tags; 
			if(get_option('mp_sharebuttons_post_page')==true):
			mp_shareButtons(get_permalink($post->ID) , get_the_title($post->ID), false );
			endif; 
			
		}

		elseif ( has_post_format( 'audio' )) {			
			?>
			<h2 class="entry-title"><a title="Read the full article" href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
			<?php 
			musicpro_get_post_links();
			$audio =  '[audio mp3='.get_post_meta($post->ID, '_format_audio_mp3', true).' ogg='.get_post_meta($post->ID, '_format_audio_ogg', true).']';
			echo do_shortcode($audio);
			the_excerpt(); echo $tags;
			if(get_option('mp_sharebuttons_post_page')==true):
			mp_shareButtons(get_permalink($post->ID) , get_the_title($post->ID), false );
			endif; 
	
		}

		elseif ( has_post_format( 'video' )) {
			?>
			<h2 class="entry-title"><a title="Read the full article" href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
			<?php musicpro_get_post_links(); ?>
			<div class="mp-video-container frame">
				<?php echo get_post_meta($post->ID, '_format_video_embed', true); ?>
			</div>
			<?php the_excerpt(); echo $tags;
			if(get_option('mp_sharebuttons_post_page')==true):
			mp_shareButtons(get_permalink($post->ID) , get_the_title($post->ID), false );
			endif; 
		}

		elseif ( has_post_format( 'image' )) {
			$args = array(
			   'post_type' => 'attachment',
			   'numberposts' => -1,
			   'post_status' => null,
			   'post_parent' => $post->ID
			  );
			  $attachments = get_posts( $args );
			?>
			<h2 class="entry-title"><a title="Read the full article" href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
			<?php musicpro_get_post_links(); ?>
			<p>
				<a href="<?php echo $attachments[0]->guid; ?>" class="preview zoom fancybox">
					<?php the_post_thumbnail('post-image') ; ?>
				</a>
			</p>
			<?php the_excerpt(); echo $tags;
			if(get_option('mp_sharebuttons_post_page')==true):
			mp_shareButtons(get_permalink($post->ID) , get_the_title($post->ID), false );
			endif; 
		
		}elseif ( has_post_format( 'gallery' )) {
			$args = array(  
			    'numberposts' => -1, // Using -1 loads all posts  
			    'orderby' => 'menu_order', // This ensures images are in the order set in the page media manager  
			    'order'=> 'ASC',  
			    'post_mime_type' => 'image', // Make sure it doesn't pull other resources, like videos  
			    'post_parent' => $post->ID, // Important part - ensures the associated images are loaded 
			    'post_status' => null, 
			    'post_type' => 'attachment'  
			);  
			  
			$images = get_children( $args );
			?>
			<script type="text/javascript">
				jQuery(function($){
				  $("#slides<?php the_ID(); ?>").slides({
				    effect: 'fade',
				    fadeSpeed: 1000,
				    crossfade: true,
				    preload: true,
				    // preloadImage: 'css/img/ajax-loader.gif',
				    play: 5000,
				    pause: 2500,
				    hoverPause: true,
				    paginationClass: 'slides-pagination'
				  });
				});
			</script>
			<h2 class="entry-title"><a title="Read the full article" href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
			<?php musicpro_get_post_links(); ?>
			<?php if($images){ ?>  
			<div id="slides<?php the_ID(); ?>" class="slides">  
			    <div class="slides_container">
			   	<?php foreach($images as $image){ ?>  
			    	<div>
			    		<img src="<?php echo $image->guid; ?>" alt="<?php echo $image->post_title; ?>" title="<?php echo $image->post_title; ?>">
			    	</div>
			    	<?php  } ?>
			    </div>
			</div>  
			<?php }   
			the_excerpt(); echo $tags;
			if(get_option('mp_sharebuttons_post_page')==true):
			mp_shareButtons(get_permalink($post->ID) , get_the_title($post->ID), false );
			endif; 
		}

		else {
			?>
			<h2 class="entry-title"><a title="Read the full article" href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
			<?php
			musicpro_get_post_links();
			if(has_post_thumbnail( $post->ID )):
			?>
			<p>
				<a href="<?php the_permalink(); ?>" class="preview" title="Read the full article">
					<?php the_post_thumbnail() ; ?></a>
			</p>
			
			<?php
			endif;
			the_excerpt();
			echo $tags;
			if(get_option('mp_sharebuttons_post_page')==true):
			mp_shareButtons(get_permalink($post->ID) , get_the_title($post->ID), false );
			endif; 
		}

	?>
	<?php edit_post_link( __( 'Edit', 'musicpro' ), '<br><span class="edit-link">', '</span>' ); ?>

	<div class="separator"></div>
</article>
 
[MENTION=36762]BHB36[/MENTION]
Eso es el loop del single.php, preciso el loop del inicio(index.php).
Además dime, cuantos artículos tenes publicados en total?
 
[MENTION=18661]Lopezito[/MENTION] pocos amigo apenas empiezo, tengo 6 entradas.

- - - Actualizado - - -

Insertar CODE, HTML o PHP:
<?php get_header(); ?>
	<div class="row">
		<div class="grid_12" id="intro">
			<div class="grid_7 alpha">
				<h1>Blog</h1>
			</div>
			<?php if(get_option('mp_searchbar')!='true'): ?>
			<?php get_template_part('searchform', 'posts'); ?>
			<?php endif; ?>
			<div class="clear"></div>
		</div>
	</div>
	
	</header>
	<!-- END HEADER -->

	<!-- MAIN CONTENT -->
	<section id="main-container">
		<div class="row">
			<div class="grid_8" id="blog">
				 <?php if(have_posts()): while(have_posts()): the_post(); ?>
	                                        
	                                       <?php get_template_part('loop', 'post'); ?>
	                                        
	                                       <?php endwhile; ?> 
				<?php else: ?>
					<?php require THEME_DIR.'/empty.php'; ?>
	                                       <?php endif; ?>
	                                       <?php pagination(); ?>                                        
			</div>

			<?php get_sidebar(); ?>
		</div>
	</section>
	<!-- END MAIN CONTENT -->

<?php get_footer(); ?>
 

Por favor, dime de que archivo es ese código.
 
[MENTION=18661]Lopezito[/MENTION] ese es el index.php
 
[MENTION=18661]Lopezito[/MENTION] el loop-post.php es el que te indique de primerito.
 
Yo también tuve problemas de paginación, use el plugin wp-pagenavi y me funcionó de maravilla
 
[MENTION=36762]BHB36[/MENTION] perdoname, ayer salí y volví tarde, a ver, si sigues con el problema, fijate en functions.php si existe "pagination()", si existe pasame el código que tiene dentro de los "{}", ejemplo de la primera línea:

Insertar CODE, HTML o PHP:
function pagination() {

:encouragement: