Related Posts: add filter to control _generate_related_post_context #278

Closed
jeherve opened this Issue Feb 27, 2014 · 6 comments

Comments

Projects
None yet
6 participants
Member

jeherve commented Feb 27, 2014

Some folks don't really use categories on their sites, but still use one single "Blog" category for example. This results into the category being displayed under all Related Posts.

It would be nice to add a filter to _generate_related_post_context to allow people to override the default behaviour.

Suggested here:

xyu was assigned by jeherve Feb 27, 2014

Member

xyu commented Mar 3, 2014

This is a good point, I will add a filter however in the time being people should be able to use jetpack_relatedposts_returned_results to filter the results. (They have to walk down the tree to filter.)

@xyu xyu added a commit to xyu/jetpack that referenced this issue Mar 3, 2014

@xyu xyu Add a filter for post context in related posts
`jetpack_relatedposts_filter_post_context` can now be used to filter the
post context line ('In ...', 'X Comments', etc.). This resolves #278
f769439

xyu closed this in #294 Mar 3, 2014

Hi All. It might be handy to document this filter on the customize page for Related Post Module: http://jetpack.me/support/related-posts/customize-related-posts/.

kerim commented Sep 29, 2014

I would very much appreciate having some code I could copy and paste into my functions.php in order to apply this filter. I spent some time trying to figure it out on my own, but I'm afraid I don't really understand how these filters work. Thanks.

yuk75 commented Jul 9, 2015

How do we use this exactly? :)

Member

jeherve commented Jul 9, 2015

@yuk75 Here is an example:
http://jetpack.me/support/related-posts/customize-related-posts/#nocontext

If you need more help, do not hesitate to post in the Jetpack support forums or send us an email!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment