Title: Problem with loop&#8230;
Last modified: August 19, 2016

---

# Problem with loop…

 *  [sendoushi](https://wordpress.org/support/users/sendoushi/)
 * (@sendoushi)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/problem-with-loop-1/)
 * Good afternoon for everyone,
    I’ll get straight to the point.
 * I’ve created, tested and used the wordpress website under the domain [http://www.DOMAIN.com/wp/](http://www.DOMAIN.com/wp/)
   but when I finished the work I wanted to get it to [http://www.DOMAIN.com](http://www.DOMAIN.com)
   so I went to general settings, changed the [http://www.DOMAIN.com/wp](http://www.DOMAIN.com/wp)
   to [http://www.DOMAIN.com](http://www.DOMAIN.com) and then moved the files to
   [http://www.DOMAIN.com](http://www.DOMAIN.com).
    I have “More Fields” plugin 
   so, I had to change all Custom Fields and how did I do that? Through PHPMyAdmin,
   directly on the database. On the “edit post” I couldn’t change because it would
   go always to the /wp/ link. So, I changed on the database, then I went to “Edit
   post” updated list and used the custom as it should. No problem here.
 * The problem comes here… on my index I have the loop, the simple one:
 *     ```
       <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
       	<?php endwhile; else: ?>
       <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
       <?php endif; ?>
       ```
   
 * (I deleted the content because there is no problem with it)
    On the loop it only
   shows me 10 posts! I unpublished the later ones and published again, no change,
   changed the date of the later ones to “right now” and it appeared but then… only
   shows 10 posts, the other 10th post was gone. I created new posts… same… only
   shows 10 posts!
 * On my single page I have this code:
 *     ```
       <?php
       $debut = 0; //The first article to be displayed
       ?>
       <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
       	<?php
       $myposts = get_posts('numberposts=-1&offset=$debut');
       foreach($myposts as $post) :
       ?>
       <?php endforeach; ?>
       	<?php endwhile; else: ?>
       <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
       <?php endif; ?>
       ```
   
 * And it works fine! It shows all the posts. (I can’t use it on index because it
   will replicate everything)
 * What should I do? Anyone knows what is going on?

Viewing 1 replies (of 1 total)

 *  Thread Starter [sendoushi](https://wordpress.org/support/users/sendoushi/)
 * (@sendoushi)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/problem-with-loop-1/#post-1917392)
 * Well… I’m kind of … The error was: on settings I had to show just 10 posts.
 * Sorry.
 * But by the way… what’s the best way to port a wordpress from one location to 
   another?

Viewing 1 replies (of 1 total)

The topic ‘Problem with loop…’ is closed to new replies.

 * 1 reply
 * 1 participant
 * Last reply from: [sendoushi](https://wordpress.org/support/users/sendoushi/)
 * Last activity: [15 years, 3 months ago](https://wordpress.org/support/topic/problem-with-loop-1/#post-1917392)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
