No Previous or Next Page Navigation in Wordpress

Discussion in 'WordPress' started by jhmattern, Dec 28, 2007.

  1. #1
    I just moved my business site to Wordpress - http://jhmattern.com

    I added a company blog.

    For the moment, I'm using Wordpress' options to point the homepage to my About page (will always point to some static page), and my blog is pointed to http://jhmattern.com/blog

    If you visit the blog, and look below the two posts there, you'll see that there is no option for viewing a page of previous posts. I've gone to the Wordpress support forum and made sure the code was added to the page template for the blog address, but still nothing shows.

    I really need some kind of navigation to let people view more posts without digging through categories. Does anyone know what I can do to get this working?

    Thanks!

    Jenn
     
    jhmattern, Dec 28, 2007 IP
    sundaybrew likes this.
  2. sundaybrew

    sundaybrew Numerati

    Messages:
    7,294
    Likes Received:
    1,260
    Best Answers:
    0
    Trophy Points:
    560
    #2
    Hi Jenn,

    Happy Holidays :)

    I have recently become a wordpress Junkie , striping it down and learning it from base up.

    Here is what you need :)

    In "single.php" and "index.php"

    Make sure you have the following code


    <div class="alignleft"><?php previous_post_link('&laquo; %link') ?></div>
    			<div class="alignright"><?php next_post_link('%link &raquo;') ?></div>
    PHP:
    If you add that , it will give you the posts

    Nice part is that wordpress is VERY flexible

    Let me know if you need more help

    Maybe whoever coded this template for you forgot that.

    Also this is wordpress 2.3 right?
     
    sundaybrew, Dec 28, 2007 IP
    jhmattern likes this.
  3. jhmattern

    jhmattern Illustrious Member

    Messages:
    8,909
    Likes Received:
    794
    Best Answers:
    2
    Trophy Points:
    455
    #3
    It was already in there. :( I'm not sure if the problem is with the theme (sonia) or with the fact that I'm using the Wordpress options to have a static page on the homepage with my blog on another page I'd chosen.

    Scratch that - it's not the Wordpress options. I just put the posts back on the homepage temporarily, and still no navigational links. :(
     
    jhmattern, Dec 28, 2007 IP
  4. sundaybrew

    sundaybrew Numerati

    Messages:
    7,294
    Likes Received:
    1,260
    Best Answers:
    0
    Trophy Points:
    560
    #4
    Yea , its the theme,

    Someone messed it up for sure, :)

    This is why I just started coding my own themes for this reason

    If its in there and it doesn't work, then yea, they code is messed

    Try another theme and see if it works :)
     
    sundaybrew, Dec 28, 2007 IP
  5. jhmattern

    jhmattern Illustrious Member

    Messages:
    8,909
    Likes Received:
    794
    Best Answers:
    2
    Trophy Points:
    455
    #5
    It's not working on the default theme either actually, now that I just checked. :(

    Here's the index.php file if that helps at all:

    <?php get_header(); ?>
    
    
    	<?php if (have_posts()) : ?>
    		
    		<?php while (have_posts()) : the_post(); ?>
    				
    			<div class="post" id="post-<?php the_ID(); ?>">
    				<h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
    				<?php the_excerpt(); ?>
    				<p class='datum'><?php the_time('F jS Y') ?> <img src="<?php bloginfo('template_directory'); ?>/images/strelica2.gif" alt='' /> <a href="<?php the_permalink() ?>">READ MORE</a> <img src="<?php bloginfo('template_directory'); ?>/images/strelica2.gif" alt='' /> <?php comments_popup_link('NO COMMENTS', '1 COMMENT', '% COMMENTS'); ?></p>	
    			</div>
    			
    		<?php endwhile; ?>
    
    <div class="navigation">
    <div class="alignleft"><?php posts_nav_link('','','&laquo; Previous Entries') ?></div>
    <div class="alignright"><?php posts_nav_link('','Next Entries &raquo;','') ?></div>
    </div>
    
    		
    			<br />
    		</div>
    		
    	<?php else : ?>
    
    		<h2 class="center">Not Found</h2>
    		<p class="center">Sorry, but you are looking for something that isn't here.</p>
    
    	<?php endif; ?>
    
    
    <?php $showSidebar = TRUE; ?>
    <?php include(TEMPLATEPATH . '/footer.php'); ?>
    Code (markup):
     
    jhmattern, Dec 28, 2007 IP
  6. sundaybrew

    sundaybrew Numerati

    Messages:
    7,294
    Likes Received:
    1,260
    Best Answers:
    0
    Trophy Points:
    560
    #6
    What version of WP is this ?

    I need to know that first
     
    sundaybrew, Dec 28, 2007 IP
  7. jhmattern

    jhmattern Illustrious Member

    Messages:
    8,909
    Likes Received:
    794
    Best Answers:
    2
    Trophy Points:
    455
    #7
    The latest - 2.3.1
     
    jhmattern, Dec 28, 2007 IP
  8. sundaybrew

    sundaybrew Numerati

    Messages:
    7,294
    Likes Received:
    1,260
    Best Answers:
    0
    Trophy Points:
    560
    #8
    sundaybrew, Dec 28, 2007 IP
  9. jhmattern

    jhmattern Illustrious Member

    Messages:
    8,909
    Likes Received:
    794
    Best Answers:
    2
    Trophy Points:
    455
    #9
    That's not what I want though - At the bottom of the post list at http://jhmattern.com/blog I want to see "previous" and "next" links to look at older posts, w/o having to look at category pages.
     
    jhmattern, Dec 28, 2007 IP
  10. sundaybrew

    sundaybrew Numerati

    Messages:
    7,294
    Likes Received:
    1,260
    Best Answers:
    0
    Trophy Points:
    560
    #10
    Oh, Can you give me an example

    Or make me a quick screen shot of what you want

    OR do you just want that at the bottom?
     
    sundaybrew, Dec 28, 2007 IP
  11. jhmattern

    jhmattern Illustrious Member

    Messages:
    8,909
    Likes Received:
    794
    Best Answers:
    2
    Trophy Points:
    455
    #11
    I think all of my other blogs have it. As an example look at http://allfreelancewriting.com - if you look below the list of posts at the bottom of the page, you'll see a link called "previous entries" which goes to a list of older posts. On any page but the first, there would also be a link for "next entries" to show newer posts.
     
    jhmattern, Dec 28, 2007 IP
  12. sundaybrew

    sundaybrew Numerati

    Messages:
    7,294
    Likes Received:
    1,260
    Best Answers:
    0
    Trophy Points:
    560
    #12
    sundaybrew, Dec 28, 2007 IP
  13. jhmattern

    jhmattern Illustrious Member

    Messages:
    8,909
    Likes Received:
    794
    Best Answers:
    2
    Trophy Points:
    455
    #13
    No. I don't care much about it going to the next individual post or previous individual post. What it's missing is the link to the next page of posts.

    For example, if you go to a blog's homepage, let's say it shows you the most recent 10 posts. When you get to the bottom, there should be some kind of link to go to the next page, which would feature the next ten posts in chronological order. Right now, there's no way for people to scroll through my recent posts like that, and that's what I'm trying to get figured out. I thought the code you mentioned before would do it, but I obviously had it confused with the individual next/previous posts instead.
     
    jhmattern, Dec 28, 2007 IP
  14. sundaybrew

    sundaybrew Numerati

    Messages:
    7,294
    Likes Received:
    1,260
    Best Answers:
    0
    Trophy Points:
    560
    #14
    Oh so you want recent posts ?

    Add this to your "single.php"

    Right before the end </div>

    <ul>
    				<?php get_archives('postbypost', 10); ?>
    			</ul><br />
    PHP:
    Or where you want it


    The "10" is the limit :)
     

    Attached Files:

    sundaybrew, Dec 28, 2007 IP
  15. jhmattern

    jhmattern Illustrious Member

    Messages:
    8,909
    Likes Received:
    794
    Best Answers:
    2
    Trophy Points:
    455
    #15
    No... it's not something to show on single.php. :) I want it showing under my post list... not under individual posts. Pretty much every wordpress blog has the functionality "out of the box," but for some reason this theme I'm using doesn't, and I just can't get it to work.

    In the example I gave before with my writing blog, you can see it right on the home page at the very bottom. The link text itself is actually "previous entries," going to the next page of posts in the history. That's what I need on this blog - so it would have to be on the index.php template or possibly the page template associated with the blog page. Single.php shouldn't come into play.
     
    jhmattern, Dec 28, 2007 IP
  16. sundaybrew

    sundaybrew Numerati

    Messages:
    7,294
    Likes Received:
    1,260
    Best Answers:
    0
    Trophy Points:
    560
    #16

    Jennifer,

    I am the ONLY guy spending all this time,.....

    CAN YOU PLEASE be more clear on what you want....

    I mean just look at the page title.,

    I am pretty much going to code a full theme in this thread

    -

    OK OK OK

    You want RECENT posts>??

    On the side bar?

    If so

    Go to >presentation>Themes>WIDGETS

    And then simple add the "recent posts" to the dynamic menu

    If you have NO "recent" in your "wigitized" side bar

    Take the code I have above and put that INTO the "sidebar.php"

    If this STILL isn't what you are looking for PLEASE spend 2 seconds and create ascreenshot of a blog that has it and circle it :)



    Oh BTW

    Thread title " No Previous or Next Page Navigation in Wordpress"


    I solved that issue long ago !


    SCREEN SHOT below of the "widgets"
     

    Attached Files:

    sundaybrew, Dec 28, 2007 IP
  17. jhmattern

    jhmattern Illustrious Member

    Messages:
    8,909
    Likes Received:
    794
    Best Answers:
    2
    Trophy Points:
    455
    #17
    No... it has nothing to do with the sidebar (I don't think I mentioned the sidebar anywhere). I know you're trying to help, so thank you for that, but I'm not sure how to be any more clear than the example I gave with the "previous entries" link on my other blog. That's exactly what I need.

    What you were solving was navigation to the previous and next post. What I need is navigation to the previous and next page listing all posts. Hopefully that helps.

    Here's a screenshot of what I was talking about on the writing blog I mentioned before. The page in the screenshot is http://allfreelancewriting.com/page/2/. The page the "previous entries" link points to is http://allfreelancewriting.com/page/3/. The "next entries" link points to the homepage (the newest entries). That's what I need happening on the business site / blog.
     

    Attached Files:

    jhmattern, Dec 28, 2007 IP
  18. sundaybrew

    sundaybrew Numerati

    Messages:
    7,294
    Likes Received:
    1,260
    Best Answers:
    0
    Trophy Points:
    560
    #18
    Oh GAWD :)

    Ok - here we go :)

    This goes in single.php if you want it on the pages :)


    <p><?php previous_post('%', 'Previous Entries:', 'no'); ?> 
    | <?php next_post('%', 'Next Entries:', 'no'); ?></p>
    PHP:
    This HAS to be want you want right?
     
    sundaybrew, Dec 28, 2007 IP
  19. jhmattern

    jhmattern Illustrious Member

    Messages:
    8,909
    Likes Received:
    794
    Best Answers:
    2
    Trophy Points:
    455
    #19
    I actually just got a PM before checking the thread from bjplink, saying to use:

    <?php posts_nav_link(' — ', __('&laquo; Previous Page'), __('Next Page &raquo;')); ?>
    Code (markup):
    and that finally has it working perfectly!

    Thanks so much to both of you for helping out. :D
     
    jhmattern, Dec 28, 2007 IP
  20. sundaybrew

    sundaybrew Numerati

    Messages:
    7,294
    Likes Received:
    1,260
    Best Answers:
    0
    Trophy Points:
    560
    #20
    Yea, either one will work :)

    Same calls :)
     
    sundaybrew, Dec 28, 2007 IP