1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How do I get this done ? Previos post - Next post

Discussion in 'WordPress' started by radiant_luv, Feb 5, 2011.

  1. #1
    I'm using "Gazette" theme by WooThemes. Underneath each article I want to show 2 links Previous post and Netx Post. I see the below code existing at blog.php

    Sippets of code from blog.php
    
    <div class="more_entries">
    <?php if (function_exists('wp_pagenavi')) wp_pagenavi(); else { ?>
    <div class="fl"><?php previous_posts_link(__('&laquo; Newer Entries ','woothemes')) ?></div>
    <div class="fr"><?php next_posts_link(__(' Older Entries &raquo;','woothemes')) ?></div>
    <br class="fix" />
    <?php } ?> 
    </div>
    
    Code (markup):
    But this doesn't show the links below the artilce. Do I have to add any code or tick something to active this? Please advice.

    Thanks.
     
    radiant_luv, Feb 5, 2011 IP
  2. Dodger

    Dodger Peon

    Messages:
    1,494
    Likes Received:
    60
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Are you using the WP_PageNavi plugin? Lester Chan is working full time now, and not sure when he updated that plugin.

    You may want to try using the regular built-in navigation and see if that works.

    
    <div class="more_entries">
       <div class="fl"><?php previous_posts_link(__('&laquo; Newer Entries ','woothemes')) ?></div>
       <div class="fr"><?php next_posts_link(__(' Older Entries &raquo;','woothemes')) ?></div>
       <br class="fix" />
    </div>
    
    PHP:
    Another thing to check is the Html source code. Maybe it is sitting in there, but hidden or the language file is messed up? If it is the language file is messed up, the anchor should still be there but without any text.
     
    Dodger, Feb 6, 2011 IP
    radiant_luv likes this.
  3. radiant_luv

    radiant_luv Peon

    Messages:
    1,327
    Likes Received:
    34
    Best Answers:
    1
    Trophy Points:
    0
    #3
    Thanks Dodger for mentioning the plugin. Actually I was not using but I wanted to use the plaugin at somepoint of my development of the website. I was trying to use the default one from the theme. It was silly of me, the number at Blog pages show at most at setting option was set to much higher, so <<older entries newer entries>> were not showing up.

    Okay, the current issue I'm unable to figure out how can I have something like this, underneat of Article 2 (Article heading 1: Previous post Article heading 3:Next post), image attached for reference.

    Thanks
     

    Attached Files:

    Last edited: Feb 7, 2011
    radiant_luv, Feb 7, 2011 IP
  4. Dodger

    Dodger Peon

    Messages:
    1,494
    Likes Received:
    60
    Best Answers:
    0
    Trophy Points:
    0
    #4
    What is the coding (if any) on your current single.php file for these links?

    And remember, it appears that the theme has a language file which may not match the phrase "Previous Post:". But that may not matter too much, for it should be close enough.
     
    Dodger, Feb 7, 2011 IP
  5. Dodger

    Dodger Peon

    Messages:
    1,494
    Likes Received:
    60
    Best Answers:
    0
    Trophy Points:
    0
    #5
    If the coding is not there, you will have to use next_post_link() and previous_post_link() right after your post content, AND all within the LOOP.

    There may be a problem with displaying this at the bottom of the post inside the loop. If you have other plugins such as Related Posts, they will appear after the links. The normal place for displaying next/previous posts is above the post title. This placement also has better SEO advantage, logically, for it is higher on the page and not muddled with other linking going on toward the end.

    Another point to make, you need to check whether there actually is a previous/next post to begin with. I am not sure, but you may not have to check. It may be built into these functions to not display anything if it does not exist. Only one way to find out though, just do it! :)
     
    Dodger, Feb 7, 2011 IP
  6. radiant_luv

    radiant_luv Peon

    Messages:
    1,327
    Likes Received:
    34
    Best Answers:
    1
    Trophy Points:
    0
    #6
    @Dodger, Thanks for your valuable inputs. Yes, with your suggestion I have been able to fix it the way i needed.

    There are many test posts so previous/next post should have been working. I can see there are default codes on single.php however they were not working, I removed them for the time being.

    Just wanted to make sure what do you mean by a language file?
     
    radiant_luv, Feb 8, 2011 IP
  7. Dodger

    Dodger Peon

    Messages:
    1,494
    Likes Received:
    60
    Best Answers:
    0
    Trophy Points:
    0
    #7
    When you see code like this:

    <?php next_posts_link(__(' Older Entries &raquo;','woothemes')) ?>
    Code (markup):
    The double-underline with text, and 'woothemes' being the textdomain, this is for internationlization (i18n). There is a .pot file with all of these text labels in them, and people can build translation files off of it. If you change that text, it will not change the translated files. Those translations would have to be rewritten.
     
    Dodger, Feb 8, 2011 IP
  8. radiant_luv

    radiant_luv Peon

    Messages:
    1,327
    Likes Received:
    34
    Best Answers:
    1
    Trophy Points:
    0
    #8
    @Dodger, Thanks much for the info. I finally able to manage sort out the issues and tweaked the theme to of my use.
     
    radiant_luv, Feb 12, 2011 IP