Skip to:
Content

Opened 3 years ago

Closed 3 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 Owned by: DJPaul
Milestone: 1.5 Priority: normal
Severity: Version: 1.5
Component: Theme 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 3 years ago.
screen cap of changes
single.php (2.4 KB) - added by modemlooper 3 years ago.
switch placement of next and previous to below post

Download all attachments as: .zip

Change History (7)

comment:1 DJPaul3 years ago

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

comment:2 DJPaul3 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?

comment:3 modemlooper3 years ago

Css for next / prev links

.meta-nav-item-options {

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

}

modemlooper3 years ago

screen cap of changes

modemlooper3 years ago

switch placement of next and previous to below post

comment:4 DJPaul3 years ago

  • Keywords 2nd-opinion added

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

comment:5 djpaul3 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

Note: See TracTickets for help on using tickets.