Home › Forums › Product Support Forums › Related Posts Pro for WordPress Support › Related posts pro not working with a custom post type
This topic contains 5 replies, has 2 voices, and was last updated by bayleafdigital 6 years, 5 months ago.
- AuthorPosts
- February 21, 2017 at 7:16 pm #12062
site password is f^aEkOfsG8VmeGug
please note that you will need to use sftp to connect to the site, and port 8789
Problem description:
We use a custom plugin called BLD knowledge base to post articles on the site. This plugin creates a custom post type. We would like to include related posts pro at the bottom of the post type. When a shortcode is inserted into the text area, the related posts don’t show. See attachment for more details on what we have tried.-
This topic was modified 6 years, 9 months ago by
bayleafdigital.
Attachments:
You must be logged in to view attached files.February 22, 2017 at 1:21 pm #12072Hi,
This one was a though one to figure out, but I found a solution.
After debugging for some time I realized that the page where the plugin shortcode is placed is not actually a post type object (post, page etc..) but a custom page displayed via the slug – so there is no global post object which Related Posts Pro could use as a reference.
This means that the plugin is not able to get the current post (as it does not exist) and check for related items, and immediately exits. Since now I have not thought about such usage of the plugin, so it was not able to handle it.I’ve made a few changes in the plugin configuration, as well as in the plugin code to try getting random items from the database when no post content is found. It’s only a temporary solution for now, I will note this one as a possible bug, and I will come up with a fix for the upcoming release.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
February 22, 2017 at 8:39 pm #12074Many thanks Ernest! I appreciate your help. We need to make these changes on two websites that are in production. Can you please advice what configuration changes you had to make to get the related posts to show?
Or, are we able to copy these plugin files into other wp installations and get the full extent of the changes you made?
Abhi
February 23, 2017 at 10:19 am #12081Hi Abhi,
If you copy the wp-content/plugins/related-posts-pro/ folder over to the live, it should do the trick. It contains all the changes.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
February 24, 2017 at 5:49 pm #12117Thanks Ernest!
June 12, 2017 at 8:36 pm #13519Hi Ernest, We are not able to use this customization because we are required to be on the latest versions of all plugins. Would it be possible for you to include this change in an upcoming release? I will be happy to pay you to speed up the inclusion.
Many thanks in advance,
Abhi
-
This topic was modified 6 years, 9 months ago by
- AuthorPosts
The forum ‘Related Posts Pro for WordPress Support’ is closed to new topics and replies.