Opened 9 years ago
Last modified 8 years ago
#34083 assigned enhancement
Feed for post type should link to post type archive if available
Reported by: | joostdevalk | Owned by: | stevenkword |
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | |
Component: | Feeds | Keywords: | has-patch dev-feedback |
Focuses: | Cc: |
Description
This post type feed: https://yoast.com/dev-blog/feed/
has
<link>https://yoast.com</link>
Even though that particular post type has a post type archive. IMHO, it should link to the post type archive https://yoast.com/dev-blog/
.
Attachments (3)
Change History (13)
#2
@
9 years ago
Is there any particular downside to not actually providing a link element back to the homepage of the site?
#3
@
9 years ago
[The spec](http://cyber.law.harvard.edu/rss/rss.html) says:
link
The URL to the HTML website corresponding to the channel.
If you're looking at a post type feed, the URL doesn't correspond to that at all, leading to weird behavior.
#5
@
9 years ago
- Keywords has-patch added
- Owner set to stevenkword
- Status changed from new to assigned
I like this idea, so I've taken a stab at the solution in 34083.patch. Admittedly, this new function is not very unit-testable, which I will probably address in a future patch. However, if anyone wants to take a look now, I'd love a second opinion. There were some other ways to approach the problem. This approach, while a little complicated, avoids regex and string functions and therefore should work with any permalink structure or lack thereof.
#9
follow-up:
↓ 10
@
8 years ago
- Keywords needs-refresh added
Seems reasonable to me. Patch looks overly complex at first glance though. Also, do we have to access $wp_query
directly?
#10
in reply to:
↑ 9
@
8 years ago
- Keywords needs-refresh removed
Replying to swissspidy:
Seems reasonable to me. Patch looks overly complex at first glance though. Also, do we have to access
$wp_query
directly?
Simplified quite a bit in 34083.3.diff. No more direct access to WP_Query.
(BTW I filtered it on yoast.com so it's fixed there now)