Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Related Posts: Add filter to show Related Posts on blog/archives page #1524

Closed
chaselivingston opened this issue Jan 21, 2015 · 4 comments
Closed
Labels
[Closed] Duplicate Duplicate of an existing issue. [Feature] Related Posts [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it

Comments

@chaselivingston
Copy link
Contributor

A few requests have come in to allow Related Posts to display on the main blog or archives pages, not just single post pages, perhaps we could add a filter for this functionality.

@chaselivingston chaselivingston added [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Feature] Related Posts labels Jan 21, 2015
@samhotchkiss
Copy link
Contributor

Looks like there already is one. See jetpack-related-posts.php:1022 :
return apply_filters( 'jetpack_relatedposts_filter_enabled_for_request', $enabled );

However, I'm not sure if the JS will support more than one instance of related posts on a page-- I think that may be our bottleneck here. Maybe @xyu can chime in there?

@xyu
Copy link
Contributor

xyu commented Jan 21, 2015

Unfortunately not 😞 our JS/CSS currently only supports displaying one related post section per page and is thus restricted to single posts/pages. Our APIs are not restricted however so I suppose it's possible to build something like this into a theme / plugin using the provided Jetpack_RelatedPosts_Raw() class:

https://github.com/Automattic/jetpack/blob/master/modules/related-posts/jetpack-related-posts.php#L1076-L1126

EDIT: A usage example, this just prints out titles for related items so not very useful but one can inflate the posts and do whatever with them. https://gist.github.com/xyu/1ad9f53bb355ec6c868b

@richardmtl
Copy link
Contributor

Requested in 2306875-t

@samhotchkiss samhotchkiss modified the milestone: Needs Triage Aug 28, 2015
@jeherve jeherve modified the milestones: Community, Needs Triage Feb 16, 2016
@jeherve
Copy link
Member

jeherve commented Feb 16, 2016

Closing as duplicate of #409

@jeherve jeherve closed this as completed Feb 16, 2016
@jeherve jeherve added the [Closed] Duplicate Duplicate of an existing issue. label Feb 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Closed] Duplicate Duplicate of an existing issue. [Feature] Related Posts [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it
Projects
None yet
Development

No branches or pull requests

5 participants