<?php while (have_posts()) : the_post(); ?> <div>TOP NEWS <?php previous_post_link('%link', '>', TRUE) ; ?> </div> <?php $row = get_post_meta(get_the_id(), 'video');?> <?php echo $row; ?> <div class="post" id="post-<?php the_ID(); ?>"> <a href="<?php the_permalink(); ?>"><h2><?php the_title(); ?></h2></a> <h3>by <?php the_author(); ?></h3> </div> <?php the_content('Read more »'); ?> <?php previous_post_link('%link', 'Prev post in category', TRUE); ?> <?php endwhile;?> <?php wp_reset_query();?> <?php endif;?>
Am with such codes during my static page. after i click on the previous_publish_link , it is going towards the single page to exhibit the publish. i have to show the publish within the same static page. Anybody have idea?
Automatically, that's what previous_publish_link does. If you wish to load the following publish on a single page then you will have to consider AJAX. It may sound frightening, but it's really fairly simple when utilizing it along with jQuery. Take a look in the .get() function in jQuery.
You will have to allow it to be so clicking the prior button transmits a get request to jQuery, and fills a div using the content of this page.