- Tags: wpgrahql, yarpp, related-posts
- Requires at least: 5.1
- Tested up to: 5.6.2
- Requires PHP: 7.2
- Stable tag: 0.0.1
- License: GPLv2 or later
- License URI: http://www.gnu.org/licenses/gpl-2.0.html
Creates a relatedPosts field in Post type with wp-graphql. You must have installed wp-graphql and YARPP.
- Install the plugin wp-graphql
- Install the plugin yarpp (Yet Another Related Posts Plugin)
- Configure them following their instructions.
- Install this plugin
- Activate the plugin through the 'Plugins' menu in WordPress
- Use it with wp-graphql. The field "relatedPosts" will be available within the Post type in GraphQL schema.
{
post(id: 235912, idType: DATABASE_ID) {
title
relatedPosts(where: { limit: 1 }) {
nodes {
title
slug
}
}
}
}