Title: [Theme] Error on my loop?
Last modified: August 31, 2016

---

# [Theme] Error on my loop?

 *  [Silv3rs](https://wordpress.org/support/users/silv3rs/)
 * (@silv3rs)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/theme-error-on-my-loop/)
 * The loop looks good and no errors but when i paginating the loop didn’t works
   and not change the posts showed but the page/2 or page/3 is showed in the url.
 * Elsewhere my code is:
 *     ```
       <div class="uk-grid contenido" id="contenido">
               <div class="uk-width-1-6 uk-hidden-small uk-hidden-medium"></div>
               <div class="uk-width-large-2-6 uk-width-small-1-1 uk-width-medium-1-2">
                   <button class="uk-button-primary" type="button">Al momento</button>
                   <hr class="uk-grid-divider">
                   <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
   
           <article class="uk-article">
               <h2 class="uk-article-title"><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
               <p class="uk-article-Meta p4d"><?php the_time('l j'); ?> de <?php the_time('F'); ?> de <?php the_time('Y'); ?> - Hace <?php echo human_time_diff( get_the_time('U'), current_time('timestamp') ); ?> | <?php $categories = get_the_category();
               $separator = ','; $output = ''; if ( ! empty( $categories ) ) {foreach( $categories as $category ) {$output .= '<a href="' . esc_url( get_category_link( $category->term_id ) ) . '"alt="'.esc_attr(sprintf(__('Ver las noticias en %s', 'textdomain' ), $category->name ) ) . '">' . esc_html( $category->name ) . '</a>' . $separator; } echo trim( $output, $separator );} ?> | <?php if(function_exists('the_views')) { the_views(); } ?></p>
               <p class="uk-article-lead"><?php echo substr(get_the_excerpt(), 0,130); ?>...<a class="more" href="<?php the_permalink(); ?>">(+)</a></p>
               <a href="<?php the_permalink(); ?>"><div class="uk-thumbnail uk-thumbnail-large uk-overlay-hover uk-overlay-grayscale"><?php echo get_the_post_thumbnail($post->ID, 'articulo-normal-index'); ?></div></a>
               <p class="uk-article-meta"><?php $categories = get_the_category();
               $separator = ','; $output = ''; if ( ! empty( $categories ) ) {foreach( $categories as $category ) {$output .= '<a href="' . esc_url( get_category_link( $category->term_id ) ) . '"alt="'.esc_attr(sprintf(__('Ver las noticias en %s', 'textdomain' ), $category->name ) ) . '">' . esc_html( $category->name ) . '</a>' . $separator; } echo trim( $output, $separator );} ?> / <?php the_title(); ?></p>
               <hr class="uk-article-divider">
           </article>
                       <?php endwhile; ?>
                       <?php numeric_posts_nav(); ?>
                   <?php else : ?>
                               <p>Disculpa, no hay articulos</p>
                       <?php endif; ?>
   
               </div>
               <div class="separate uk-hidden-small uk-hidden-medium"></div>
               <div class="uk-width-large-1-6 uk-hidden-small uk-width-medium-1-2 uk-block-muted min-padding">
                   <button class="uk-button-primary" type="button">Destacadas</button>
                   <hr class="uk-grid-divider">
   
                   <article class="uk-article uk-text-center">
                       <?php
                           global $post;
                           $args = array( 'numberposts' => 10, 'category_name' => 'destacada' );
                           $posts = get_posts( $args );
                           foreach( $posts as $post ): setup_postdata($post);
                       ?>
   
                   <h2 class="uk-article-title-small uk-text-center"><a href="<?php the_permalink(); ?>" title="<?php                      the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
                   <p class="uk-article-meta uk-text-center"><?php the_time('l j'); ?> de <?php the_time('F'); ?> de <?php the_time('Y'); ?> -            Hace <?php echo human_time_diff( get_the_time('U'), current_time('timestamp') ); ?></p>
                   <a href="<?php the_permalink(); ?>"><div class="uk-thumbnail uk-thumbnail-medium uk-container-center"><?php echo get_the_post_thumbnail($post->ID, 'articulo-destacadas-sidebar'); ?></div></a>
                       <hr class="uk-article-divider">
                   </article>
   
                       <?php
                           endforeach;
                       ?>
   
                   <div class="uk-text-center data-uk-lightbox"><?php dynamic_sidebar( 'anuncio-destacadas' ); ?></div>
   
               </div>
               <?php get_sidebar(); ?>
               <div class="uk-width-1-6"></div>
           </div>
       ```
   
 * Can you help me? thank you in advance

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [Silv3rs](https://wordpress.org/support/users/silv3rs/)
 * (@silv3rs)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/theme-error-on-my-loop/#post-6983517)
 * Sorry i forget, by these error in the loop the posts are showed 2 hours or more
   late and the error of the pagination :/
 *  Thread Starter [Silv3rs](https://wordpress.org/support/users/silv3rs/)
 * (@silv3rs)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/theme-error-on-my-loop/#post-6983693)
 * Any?

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘[Theme] Error on my loop?’ is closed to new replies.

## Tags

 * [loop](https://wordpress.org/support/topic-tag/loop/)

 * 2 replies
 * 1 participant
 * Last reply from: [Silv3rs](https://wordpress.org/support/users/silv3rs/)
 * Last activity: [10 years, 4 months ago](https://wordpress.org/support/topic/theme-error-on-my-loop/#post-6983693)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
