• 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.