Problema de paginación en wp-pagenavi

  • Autor Autor micka1007
  • Fecha de inicio Fecha de inicio
M

micka1007

Hola tengo un problema con el plugin wp-pagenavi en mi sitio gigapeliculas.com
Lo instale y inserte el siguiente código

PHP:
<?php if (function_exists('wp_pagenavi')) {
wp_pagenavi();
} else { ?>
  <div class="navigation">
    <div class="alignleft">
      <?php next_posts_link(__('Older Entries','my_theme')); ?>
    </div>
    <div class="alignright">
      <?php previous_posts_link(__('Newer Entries','my_theme')); ?>
    </div>
  </div>
<?php } ?>

justo debajo de
PHP:
<?php endwhile; ?>

Pero como podéis observar cuando quieres cambiar de pagina la url cambia pero me sigue mostrando la primera pagina
Pero lo raro es que eso solo me pasa en el index.php en category.php y search.php me funciona perfectamente.

También cuando le das a mas vistas y mejor puntuadas el cambio de pagina sube arriba de la pagina en vez de estar abajo del todo.

Aver si alguien me puede ayudar
GRACIAS!! :encouragement:
 
Última edición:
pon el codigo del index.php o si tiene front-page.php el del front-page...
 
Código del index.php

PHP:
<?php get_header(); ?>

			<section id="newsMovies">
			
				<h1>Nuevos estrenos</h1>
			
				<?php foreach ( get_option('newsMovies') as $id ): ?>
					<a href="<?= get_permalink($id) ?>">
							<?php if (has_post_thumbnail($id)) : ?>
								<?= get_the_post_thumbnail($id, 'front-news'); ?>
							<?php else : ?>
								<img width="130" src="<?= bloginfo('template_directory').'/images/no-image.png'; ?>" class="wp-post-image">
							<?php endif; ?>
					</a>
				<?php endforeach; ?>
			
				<?php /* while ( $rm_newsMovies->have_posts() ) : $rm_newsMovies->the_post(); ?>
					<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
							<?php if (has_post_thumbnail()) : ?>
								<?= the_post_thumbnail('front-news'); ?>
							<?php else : ?>
								<img width="130" src="<?= bloginfo('template_directory').'/images/no-image.png'; ?>" class="wp-post-image">
							<?php endif; ?>
					</a>
				<?php endwhile; */ ?>
                
				
			</section>

			<?php get_sidebar(); ?>
		
			<section id="movies">
			
				<nav>
					<a href="#news" class="active">Novedades</a>
					<a href="#views">M&aacute;s vistas</a>
					<a href="#score">Mejor puntuadas</a>
				</nav>
                
				
				<?php while ( $rm_movies->have_posts() ) : $rm_movies->the_post(); ?>
				
					<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

						<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
							<?php if (has_post_thumbnail()) : ?>
								<?php the_post_thumbnail(); ?>
							<?php else : ?>
								<img src="<?= bloginfo('template_directory').'/images/no-image.png'; ?>" class="wp-post-image">
							<?php endif; ?>
                           
						</a>
						
						<div class="info">
						
							<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><h2><?php the_title(); ?></h2></a>
							<?php echo (is_object(PostRatings())) ? PostRatings()->getControl($post->ID, false, true) : ''; ?>
							<br />
							<?php sm_flags($post->ID); ?>
							
						</div>
						
					</article>


				<?php endwhile; ?>

<?php if (function_exists('wp_pagenavi')) {
wp_pagenavi();
} else { ?>
  <div class="navigation">
    <div class="alignleft">
      <?php next_posts_link(__('Older Entries','my_theme')); ?>
    </div>
    <div class="alignright">
      <?php previous_posts_link(__('Newer Entries','my_theme')); ?>
    </div>
  </div>
<?php } ?>
			</section>
            

<?php get_footer(); ?>
 
Es extraño, debería funcionar. Prueba a reemplazar esto:

Insertar CODE, HTML o PHP:
                <?php while ( $rm_movies->have_posts() ) : $rm_movies->the_post(); ?>

Por esto

Insertar CODE, HTML o PHP:
<?php 
global $query_string;
query_posts($query_string);
while ( $rm_movies->have_posts() ) : $rm_movies->the_post(); 
?>

o por esto otro:


Insertar CODE, HTML o PHP:
<?php 
global $query_string;
query_posts($query_string);
if (have_posts()) : while (have_posts()) : the_post();
?>
 
Última edición:
[MENTION=19827]micka1007[/MENTION]

A mi me funciona bien el wp-pagenavi con el codigo:

Insertar CODE, HTML o PHP:
<?php wp_pagenavi(); ?>
 
Me sigue sin funcionar con ese codigo. :fatigue::fatigue:

A lo mejor es que mi theme no soporta wp-pagenavi. Conocéis otro plugin parecido??
 
El problema no es el plugin... es el theme que está mal. No te va a funcionar ninguna paginación ni la que viene por defecto. Si es un theme gratis dime donde lo bajo y te lo veo mas a fondo, o si no lo es y quieres pasarmelo me lo envias por MP y te lo miraré.
 
Atrás
Arriba