Archived topic
How to Show Related Posts in Generate Press Without a Plugin
5 replies · Started by Sibi Paul on January 10, 2020
Hello,
is there any option now Implemented in GP?
to show related posts without a plugin?
Also, Let me know...
How can I add a Particular code to show just after the posts Text... every post...
Hi there,
A plugin is required for displaying related post as Tom explained here:
https://generatepress.com/forums/topic/add-related-post-without-plugins/#post-185346
Otherwise you'd need a hire a developer to create a custom solution for you.
Code is code - it doesn't matter if it's added as a plugin or functions, it's still code.
As for text after post content, try the after_content hook in hooks elements:
https://docs.generatepress.com/article/hooks-visual-guide/#single-post
https://docs.generatepress.com/article/hooks-element-overview/
Plugins Create Extra Database Tables...
But, Custom Codes we added something like hook... not creates any tables in SQL.
That's why I try to avoid install plugin if not so important.
If it's a well-coded plugin then it shouldn't really matter.
If you need to hire a developer then a site like this might help:
https://codeable.io/
I think the best way would be to use the plugin coded by the generatepress lead programmer:
Hello,
I have downloaded the plugin made by the Generatepress Author "WP show posts" with the right settings.
After installing the plugin, I created a post list by going to WP show posts in the sidebar of my installation. Then, on the right side of the screen, I copied the PHP function located on the right side of the screen in my clipboard.

Then, I created a new element (premium feature) by visiting Appearance > elements, with a hook, generate after content with the following code, I pasted the PHP code that I have copied from the WP show posts plugin. So in the following code below, replace the php with the php you copied from wp show posts

<div>
<hr>
<h2>Related Posts:</h2>
<?php if ( function_exists( 'wpsp_display' ) ) wpsp_display( 46457 ); ?>
</div>
I actually had a chat about this with Tom and he said that WPSP is not designed to be used for related posts.
We would still recommend an actual related posts plugin.