• I’ve spent lots of time to getting my site working, and now I’m facing these problem:

    When you go to my homepage and bottom of my homepage click 1,2 or next, it showing same post for next page.

    I needed a previous/next link at the bottom of my home page, so I have instal WP-Pagenavi Plugin and added the following code to my home.php file:

    <?php endwhile; ?>
    
    				<!--This is where you can specify the archive link for each section. Replace the # with the appropriate URL-->
    				<div id="navigation">
    <?php if(function_exists('wp_pagenavi')) : ?>
    <?php wp_pagenavi() ?>
    <?php else : ?>
            <p><?php posts_nav_link(' — ', __('&laquo; Previous Page'), __('Next Page &raquo;')); ?></p>
            <div class="clear"></div>
    <?php endif; ?>
    
    </div>

    Now I’ve got next/previous links, but from the home page it doesn’t change the posts on page 2, it just redisplays the same posts from the main page.

    It works fine on the Archives page, please help me anyone.

    Full code of my home.php

    <?php get_header(); ?>
    
    <div id="content">
    
    	<div id="homepage">
    
        	<?php /*Check for the 'gallery_styles' function. if it's there, then include it. If not, do nothing*/ ?>
    		<?php if (function_exists('gallery_styles')) : ?>
    
            <div id="homepagetop">
    
                <div class="featuredtop">
    
    				<?php include (ABSPATH . '/wp-content/plugins/featured-content-gallery/gallery.php'); ?>
    
    			</div>
    
    		</div>
    
    		<?php endif; ?>
    
    		<div id="homepageleft">
    
    			<!--This section is currently pulling category ID #1, and can be switched by changing the cat=1 to show whatever category ID you would like in this area.-->
    
    			<div class="hpfeatured">
    			<h3> New Technology </h3>
    
    				<!--This is where the thumbnails are found for the homepage bottom section - note the custom field name for this image is "thumbnail". Recommended image size is 70x70, as the stylesheet is written for this size.-->
    
    				<?php $recent = new WP_Query("cat=4&showposts=3"); while($recent->have_posts()) : $recent->the_post();?>
    				<?php if( get_post_meta($post->ID, "thumbnail", true) ): ?>
    				    <a href="<?php the_permalink() ?>" rel="bookmark"><img style="float:left;margin:0px 10px 0px 0px;" src="<?php echo get_post_meta($post->ID, "thumbnail", true); ?>" alt="<?php the_title(); ?>" /></a>
    				<?php else: ?>
    				   	<a href="<?php the_permalink() ?>" rel="bookmark"><img style="float:left;margin:0px 10px 0px 0px;"  src="<?php bloginfo('template_url'); ?>/images/thumbnail.png" alt="<?php the_title(); ?>" /></a>
    				<?php endif; ?>
    				<b><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></b>
    				<?php the_content_limit(80, ""); ?> <?php pvc_stats($postid); ?>
    
    				<div style="border-bottom:1px dotted #94B1DF; margin-bottom:10px; padding:0px 0px 10px 0px; clear:both;"></div>
    
    				<?php endwhile; ?>
    
    				<!--This is where you can specify the archive link for each section. Replace the # with the appropriate URL-->
    
    				<b><a href="?cat=4" rel="bookmark">Read More Posts From This Category</a></b>
    
    			</div>			
    
    		</div>
    
    		<div id="homepageright">
    
    			<!--This section is currently pulling category ID #1, and can be switched by changing the cat=1 to show whatever category ID you would like in this area.-->
    
    			<div class="hpfeatured">
    			<h3> Tech News </h3>
    
    				<!--This is where the thumbnails are found for the homepage bottom section - note the custom field name for this image is "thumbnail". Recommended image size is 70x70, as the stylesheet is written for this size.-->
    
    				<?php $recent = new WP_Query("cat=2&showposts=3"); while($recent->have_posts()) : $recent->the_post();?>
    				<?php if( get_post_meta($post->ID, "thumbnail", true) ): ?>
    				    <a href="<?php the_permalink() ?>" rel="bookmark"><img style="float:left;margin:0px 10px 0px 0px;" src="<?php echo get_post_meta($post->ID, "thumbnail", true); ?>" alt="<?php the_title(); ?>" /></a>
    				<?php else: ?>
    				   	<a href="<?php the_permalink() ?>" rel="bookmark"><img style="float:left;margin:0px 10px 0px 0px;"  src="<?php bloginfo('template_url'); ?>/images/thumbnail.png" alt="<?php the_title(); ?>" /></a>
    				<?php endif; ?>
    				<b><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></b>
    				<?php the_content_limit(80, ""); ?> <?php pvc_stats($postid); ?>
    
    				<div style="border-bottom:1px dotted #94B1DF; margin-bottom:10px; padding:0px 0px 10px 0px; clear:both;"></div>
    
    				<?php endwhile; ?>
    
    				<!--This is where you can specify the archive link for each section. Replace the # with the appropriate URL-->
    
    				<b><a href="?cat=2" rel="bookmark">Read More Posts From This Category</a></b>
    
    			</div>		
    
    		</div>
    		<div id="homepagebottom">
    
    			<div class="hpbottom">
    
    				<h3> Latest Tech Posts </h3>
    
    				<!--This is where the thumbnails are found for the homepage bottom section - note the custom field name for this image is "hpbottom". Recommended image size is 70x70, as the stylesheet is written for this size.-->
    
    				<?php $recent = new WP_Query("showposts=4"); while($recent->have_posts()) : $recent->the_post();?>
    				<?php if( get_post_meta($post->ID, "hpbottom", true) ): ?>
    				    <a href="<?php the_permalink() ?>" rel="bookmark"><img style="float:left;margin:0px 10px 0px 0px;" src="<?php echo get_post_meta($post->ID, "hpbottom", true); ?>" alt="<?php the_title(); ?>" /></a>
    				<?php else: ?>
    				   	<a href="<?php the_permalink() ?>" rel="bookmark"><img style="float:left;margin:0px 10px 0px 0px;"  src="<?php bloginfo('template_url'); ?>/images/thumbnail.png" alt="<?php the_title(); ?>" /></a>
    				<?php endif; ?>
    				<b><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></b>
    				<?php the_content_limit(480, "[Read more of this article]" ); ?>
    
    <?php pvc_stats_update($postid); ?>
    
    				<div style="border-bottom:1px dotted #2255AA; margin-bottom:10px; padding:0px 0px 10px 0px; clear:both;"></div>
    
    				<?php endwhile; ?>
    
    				<!--This is where you can specify the archive link for each section. Replace the # with the appropriate URL-->
    				<div id="navigation">
    <?php if(function_exists('wp_pagenavi')) : ?>
    <?php wp_pagenavi() ?>
    <?php else : ?>
            <p><?php posts_nav_link(' — ', __('&laquo; Previous Page'), __('Next Page &raquo;')); ?></p>
            <div class="clear"></div>
    <?php endif; ?>
    
    </div>
    				<!--<b><a href="?cat=4" rel="bookmark">Read More Posts From This Category</a></b>-->
    
    			</div>
    
    		</div>
    
    	</div>
    
    <?php include(TEMPLATEPATH."/sidebar.php");?>
    
    </div>
    
    <!-- The main column ends  -->
    
    <?php get_footer(); ?>

    Thank you all………………

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Previous/next link at the bottom of my home page not working, please help’ is closed to new replies.