evensgoddard
Forum Replies Created
Viewing 1 replies (of 1 total)
-
Forum: Fixing WordPress
In reply to: WP_Query Loop, pagination and tittle tag of a pageThis is why I love to use WordPress, there’s always a super easy way to solve everything 😀
After a while I got it working just by adding
wp_reset_query();
So the final code looks like this:<?php if ( get_query_var('paged') ) { $paged = get_query_var('paged'); } elseif ( get_query_var('page') ) { $paged = get_query_var('page'); } else { $paged = 1;} $myQuery = new WP_Query( array( 'category_name' => 'farandula','posts_per_page' => '1','post_type' => 'post', 'paged' => $paged )); if ( have_posts() ) : $count = 0; while ( $myQuery->have_posts() ) : $myQuery->the_post(); $count++; ?> <div class="the-post-in-cat-wrapper"> <h2><?php the_title(); ?></h2> <p class="date">Publicado el día: <?php the_time(get_option('date_format')); ?> por <a href="<?php bloginfo('url')?>/author/<?php the_author_meta('nickname'); ?>/" title="Perfil de <?php the_author_meta('nickname'); ?>"><?php the_author_meta('nickname'); ?></a></p> <?php the_post_thumbnail('medium', array('class' => 'alignleft')); ?> <?php global $more; $more = 0; the_content('Continua leyendo este artículo...'); ?> <?php edit_post_link('Editar esta página.', '<p>', '</p>'); ?> </div> <div class="clear"></div> <?php endwhile; wp_pagenavi(); endif; wp_reset_query();?>It was an easy one but I didn’t found anything pointing to that particular solution.
Viewing 1 replies (of 1 total)