Skip to:
Content

BuddyPress.org

Opened 14 years ago

Closed 14 years ago

Last modified 8 years ago

#2982 closed defect (bug) (fixed)

single.php has wrong function and format to show next and/or previous post link.

Reported by: chestnut_jp's profile chestnut_jp Owned by: djpaul's profile DJPaul
Milestone: 1.5 Priority: normal
Severity: Version: 1.5
Component: Templates Keywords: 2nd-opinion
Cc:

Description

/bp-themes/bp-default/single.php has a wrong function and format to show the next and/or previous post link.

[ Original ]
<div class="alignleft"><?php next_posts_link( ( '&larr; Previous Entries', 'buddypress' ) ) ?></div>
<div class="alignright"><?php previous_posts_link(
( 'Next Entries &rarr;', 'buddypress' ) ) ?></div>

Should be

[ Changed to ]

<div class="alignleft"><?php next_post_link('%link', ( '&larr; Previous Entries', 'buddypress' ) ) ?></div>
<div class="alignright"><?php previous_post_link('%link',
( 'Next Entries &rarr;', 'buddypress' ) ) ?></div>

However, this still will collapse the format of page, thus I recommend:

[ Changed to ]

<table>
<tr><td class="alignleft">
<?php previous_post_link('%link', '&larr;&nbsp;%title') ?>
</td><td class="alignright">
<?php next_post_link('%link', '%title&nbsp;&rarr;') ?>
</td></tr>
</table>

Note that %title can be changed to the default of "( '&larr; Previous Entries', 'buddypress' )" and "( 'Next Entries &rarr;', 'buddypress' )"

Attachments (2)

Screen shot 2011-01-24 at 5.15.46 PM.png (59.9 KB) - added by modemlooper 14 years ago.
screen cap of changes
single.php (2.4 KB) - added by modemlooper 14 years ago.
switch placement of next and previous to below post

Download all attachments as: .zip

Change History (8)

#1 @DJPaul
14 years ago

  • Milestone changed from Awaiting Review to 1.3
  • Owner set to DJPaul
  • Status changed from new to assigned

#2 @DJPaul
14 years ago

Not using a table for this as it is a semantically inappropriate element. I also think it's a bad idea to add this at the very top of the page (i.e. where it is already, if it worked) as it pushes down the entire post. That position works on archive pages as the format of the page is very different, and you're not expecting a headline.

Does anyone have a good idea about where we can put these links in?

#3 @modemlooper
14 years ago

Css for next / prev links

.meta-nav-item-options {

width: 100%;
margin-bottom: 15px;
display: inline-block;

}

@modemlooper
14 years ago

screen cap of changes

@modemlooper
14 years ago

switch placement of next and previous to below post

#4 @DJPaul
14 years ago

  • Keywords 2nd-opinion added

Screenshot looks okay to me, thanks modemlooper. What do others think?

#5 @djpaul
14 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [4126]) Use next/prev post links in single.php. Also tweaks next/prev page links on archive/index/search templates. Props chestnut_jp and modemlooper, fixes #2982

#6 @DJPaul
8 years ago

  • Component changed from Appearance - Template Parts to Templates
Note: See TracTickets for help on using tickets.