Skip to:
Content
Pages
Categories
Search
Top
Bottom

Previous post, next post links not displaying anything

Viewing 6 replies - 1 through 6 (of 6 total)

  • Jeff Sayre
    Participant

    @jeffsayre

    Perhaps Andy decided to remove the previous_post_link( ) and next_post_link( ) function calls from the single.php file. They do exist in the stock download. Not everyone likes them.


    Kevin Pine
    Participant

    @kevinpine

    These are the two calls in that div:

    <?php next_posts_link( __( ‘« Previous Entries’, ‘buddypress’ ) ) ?>

    <?php previous_posts_link( __( ‘Next Entries »’, ‘buddypress’ ) ) ?>

    What is the proper syntax for the previous_post_link( ) and next_post_link( ) function calls?


    Kevin Pine
    Participant

    @kevinpine

    Are you saying they work in the stock download? They don’t work for me using the default theme.


    Kevin Pine
    Participant

    @kevinpine

    @Jeff, you are right, the previous_post_link( ) and next_post_link( ) function calls were removed from single.php on the testbp.org site and they are in the stock download. Seems like they don’t return anything, though.


    Jeff Sayre
    Participant

    @jeffsayre

    Kevin-

    I just noticed that there’s an error in the way each function call is coded. Try this instead:

    <?php __( next_posts_link( '« Previous Entries' ), 'buddypress' ) ?>
    <?php __( previous_posts_link( 'Next Entries »' ), 'buddypress' ) ?>

    Let me know if that works.


    Kevin Pine
    Participant

    @kevinpine

    That didn’t work for me either but your syntax correction helped. This is what I finally got to work.

    <?php __( previous_post_link( ‘« %link’), ‘buddypress’ ) ?>

    <?php __( next_post_link( ‘%link »’ ), ‘buddypress’ ) ?>

    Using ‘_post_link’ instead of ‘_posts_link’. Also ‘%link’ displays the prev/next post name hyperlinked to the post.

    You can see an example here: http://nashvillesharepoint.com/blog/2009/11/11/community-dev-testing-bp-plugins/

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Previous post, next post links not displaying anything’ is closed to new replies.
Skip to toolbar