• Hi,
    I added the nav links in my index.php page like this:
    <?php posts_nav_link(‘ · ‘,’Next entries’,’Previous entries’); ?>

    The Previous entries link is shown in the first page, but when I click it, and the second page is shown, the link is missing, and I know I have more entries.

    Does anyone know what it is the problem?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hmm… I’m not familiar with that way of inserting the navigation, personally. I usually do something like this:

    <div class="navigation">
        <div class="alignleft"><?php previous_posts_link('&laquo; Prev Page') ?></div>
        <div class="alignright"><?php next_posts_link('Next Page &raquo;') ?></div>
    </div>
    Thread Starter vintem12

    (@vintem12)

    I tried this way also, but faced the same issue.
    Do you know which page WP renders when it shows blog/page/2? Because it seems it is not index.php anymore.

    On every site I’ve ever set up, it’s still index.php. Are you using a custom built theme, or one I could download and check out?

    Thread Starter vintem12

    (@vintem12)

    It is a custom built theme, but here is how it is my index.php page:

    ?<?php get_header();?>
    <script type="text/javascript">
    	$(function(){
    		$(".home").removeClass("home").addClass("homeAtivo");
    	});
    </script>
    <!-- index.php -->
    <div class="areaPost">
    	<?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>
    		<div class="postBlog">
    			<!-- come?a um post -->
    			<div class="espTituloPost">
    				<a href="<?php the_permalink();?>" title="<?php the_title(); ?>" class="TituloPost"><?php the_title();?></a>
    			</div> <!--.espTituloPost -->
    
    			<div class="infoPost">
    				<span class="dataPost"><?php the_date(); ?></span> |
    				<!--<a href="" class="comentariosPost">10 comentários</a>-->
    				<?php comments_popup_link('Sem coment&aacute;rios', '1 coment&aacute;rio', '% coment&aacute;rios;', 'comentariosPost'); ?>
    			</div> <!--.infoPost -->
    
    			<?php the_content();?>
    
    			<div class="areaTags">
    			<!--tags: <a href="" class="tagsPost">nome_tag</a>, <a href="" class="tagsPost">nome_tag</a>, <a href="" class="tagsPost">nome_tag</a>-->
    			<?php the_tags('tags: ', ',', ''); ?>
    			</div> <!--.areaTags -->
    
    			<!-- termina um post -->
    		</div>
    	<?php endwhile; ?>
    			<div class="areaPaginacao">
    	                <?php previous_posts_link('&laquo; Prev Page') ?>
    			<?php next_posts_link('Next Page &raquo;') ?>
                        </div> <!--areaPaginacao -->
    	<?php endif; ?>
    </div> <!--.areaPost -->
    
    <?php get_sidebar(); ?>
    
    <?php get_footer();?>

    Upon initial glance, everything looks correct. Do you have a link to the functioning website?

    Thread Starter vintem12

    (@vintem12)

    Yes I do.
    https://blogedesign.com.br/site/

    I don’t know if you noticed, but I have comment at the beginning of index.php:
    <!– index.php –>

    At the home page, this comment appears, if I click Next Page, it doesn’t.

    At this point, I would do a brute force test to determine which template file it’s using, since it doesn’t seem to be using index.php when it’s on other files.

    For each file…

    1. Add .bkp to the end of the file name
    2. Refresh your page two to see if the pagination links appear
    3. Remove .bkp from the end of the file name

    Do that until you know which file it is.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Navigation links’ is closed to new replies.