WordPress.org

Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#8703 closed feature request (fixed)

Add functions to display adjacent relational links in the head

Reported by: sivel Owned by: westi
Milestone: 2.8 Priority: normal
Severity: normal Version: 2.8
Component: Template Keywords: has-patch
Focuses: Cc:

Description

Add functions to display relational links for adjacent posts in the head.

Example:

<link rel="prev" href="http://example.org/2008/11/my-previous-post" title="My Previous Post" />
<link rel="next" href="http://example.org/2008/12/my-next-post" title="My Next Post" />

Attachments (8)

8703.diff (3.2 KB) - added by sivel 9 years ago.
8703.2.diff (4.2 KB) - added by sivel 9 years ago.
8703.3.diff (8.6 KB) - added by sivel 9 years ago.
8703.4.2.diff (9.8 KB) - added by sivel 9 years ago.
add top and patch against current trunk rev
8703.4.diff (9.8 KB) - added by sivel 9 years ago.
add top and patch against current trunk rev
8703.5.diff (9.8 KB) - added by sivel 9 years ago.
should have been up and not top
8703.6.diff (9.2 KB) - added by sivel 9 years ago.
8703.patch (5.9 KB) - added by Viper007Bond 9 years ago.
Properly escape titles (namely HTML) and spaces are bad (replace them with tabs)

Download all attachments as: .zip

Change History (24)

@sivel
9 years ago

#1 @sivel
9 years ago

Would anyone like to comment on the changes proposed in this ticket? Anyone think this is a good idea to add?

#2 @westi
9 years ago

  • Owner changed from anonymous to westi
  • Status changed from new to assigned

See also #4209.

Sounds like a good idea.

How about a patch for default / classic to make use of these for single pages :-)

#3 @DD32
9 years ago

What about something for attachments too? But back/forth between the attachments of that post?

#4 @sivel
9 years ago

I'll work on both of these items. I'm not as familiar with the attachments though. I'm sure by now the patch needs updated anyway to fit into trunk.

#5 @sivel
9 years ago

Updated patch to fit into trunk and added the new functionality to the default and classic themes.

@sivel
9 years ago

#6 @westi
9 years ago

Ok.

I think it may be better to use the wp_head action rather than hardcode in the themes.

That way all themes get this functionality.

Implement it the same way as rsd_link and wlwmanifest_link.

#7 follow-up: @jidanni
9 years ago

#9131 has been marked as a duplicate of this bug.

(Why can't TRAC say that automatically here, like Bugzilla?)

#8 @jidanni
9 years ago

  • Cc jidanni@… added

#9 in reply to: ↑ 7 @sivel
9 years ago

Replying to jidanni:

#9131 has been marked as a duplicate of this bug.

(Why can't TRAC say that automatically here, like Bugzilla?)

I have made note of the additional rel values and plan on adding them to this patch. Little busy at the moment so I'll start working on this again soon.

#10 @sivel
9 years ago

  • Version changed from 2.7 to 2.8

@sivel
9 years ago

#11 @sivel
9 years ago

Support for the following link types:

index
start
prev
next

Hooking into wp_head to display these links. Still looking into adding 'toc' which points to the archive, and 'up' which points to a parent.

@sivel
9 years ago

add top and patch against current trunk rev

@sivel
9 years ago

should have been up and not top

#12 @sivel
9 years ago

new patch (8703.5.diff) which includes 'up'. I have decided to not include 'toc' for the time being.

#13 @sivel
9 years ago

From my conversation with westi, I have replaced the SQL in get_boundary_post with get_posts. New patch is 8703.6.diff

@sivel
9 years ago

#14 @westi
9 years ago

(In [10815]) Add relational links to next/prev/parent posts. See #8703 props sivel.

@Viper007Bond
9 years ago

Properly escape titles (namely HTML) and spaces are bad (replace them with tabs)

#15 @sivel
9 years ago

Ah...apologies for the spaces. The tabs must have been converted to spaces during my last copy/paste.

#16 @sivel
9 years ago

  • Cc matt@… added

#17 @ryan
9 years ago

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

(In [11062]) Formatting cleanups. Props Viper007Bond. fixes #8703

Note: See TracTickets for help on using tickets.