7 years ago
The top of single.php contains a div with class=”item-options”. Links to the previous and next posts should be displayed there but they are not.
BP 1.1.2, WPMU 188.8.131.52
This can be seen here: http://testbp.org/news/beta-release-scheduled-for-december-15/
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.
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?
Are you saying they work in the stock download? They don’t work for me using the default theme.
@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.
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.
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/
Follow BuddyPress on Twitter •
Contact Us •
Terms of Service