Title: Using previous post links when importing posts from WordPress?
Last modified: August 21, 2016

---

# Using previous post links when importing posts from WordPress?

 *  [Aikaryu](https://wordpress.org/support/users/aikaryu/)
 * (@aikaryu)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/using-previous-post-links-when-importing-posts-from-wordpress/)
 * Hi everyone!
 * I have a simple website, and I have installed a wordpress blog on it.
 * Right now, I’m “importing” the posts from the blog as news items on the news 
   section. Everything is going fine there. I’m showing 5 of them.
 * My problem is that I want to put a link to the older posts, so that when the 
   user clicks on it, the page refreshes and the other posts are shown. And I dunno
   how to do it.
 * This is the code I used to get the posts:
 *     ```
       <?php
       require_once($_SERVER [ 'DOCUMENT_ROOT'].'/blog/wp-config.php');
       $my_query = new WP_Query('showposts=5');
       while ($my_query->have_posts()) : $my_query->the_post();
       $do_not_duplicate = $post->ID;
       ?>
   
       <li>
       	<div id="big_wrapper">
       		<div id="wrapper">
       			<div id="cell">
       				<div class="content">
       					<?php the_post_thumbnail('medium'); ?>
       				</div>
       			</div>
       		</div>
   
       	    <div class="news">
       	    	<span id="title"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></span><br>
       	    	<span id="time"><?php the_time('j') ?>/<?php the_time('M') ?>/<?php the_time('Y') ?></span><br>
       	    	<span id="content"><?php the_excerpt(); ?></span><br>
       	    	<span id="see_more" style="float: right;"><a href="<?php the_permalink() ?>">SEE MORE ></a></span>
       	    </div>
       </li>
       	</div>
   
       <?php endwhile;?>
       ```
   
 * Hope you guys can help me! Thanks a lot for reading my question!

The topic ‘Using previous post links when importing posts from WordPress?’ is closed
to new replies.

## Tags

 * [excerpt](https://wordpress.org/support/topic-tag/excerpt/)
 * [old posts](https://wordpress.org/support/topic-tag/old-posts/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [Aikaryu](https://wordpress.org/support/users/aikaryu/)
 * Last activity: [12 years, 9 months ago](https://wordpress.org/support/topic/using-previous-post-links-when-importing-posts-from-wordpress/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
