Navigation links
-
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?
-
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('« Prev Page') ?></div> <div class="alignright"><?php next_posts_link('Next Page »') ?></div> </div>
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?
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ários', '1 comentário', '% comentá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('« Prev Page') ?> <?php next_posts_link('Next Page »') ?> </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?
Yes I do.
http://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…
- Add .bkp to the end of the file name
- Refresh your page two to see if the pagination links appear
- Remove .bkp from the end of the file name
Do that until you know which file it is.
- The topic ‘Navigation links’ is closed to new replies.