- This topic has 13 replies, 3 voices, and was last updated 4 years, 1 month ago by
Support Team.
- AuthorPosts
- October 4, 2018 at 7:35 am #8113
privatejeep
ParticipantThere is a new bug on my site. On a trip page “related posts” from my blog are now showing above the map.
I need this removed or fixed ASAP please.
Here is a link to a trip page on my site: https://www.privatejeep.com/itinerary/apache-falls-salt-river-canyon/
Here is a screenshot of the related posts block bug:
October 4, 2018 at 7:44 am #8115Support Team
KeymasterHello @privatejeep,
We checked the page and show the issue. This is not a bug and its not related to WP Travel. You have activated JetPack related post ( https://jetpack.com/support/related-posts/ ), which shows related post after the content. Please disable it from JetPack and issue will be solved.
Thank you!
October 4, 2018 at 8:10 am #8116privatejeep
ParticipantSo there is no way to hide the related posts on a trip page? That seems to be a huge conflict. Why would I want to remove a feature from my blog that should not be displayed on your plug-ins trip page… which is not a blog.
Is there a code I could enter into my child-theme to fix this?
October 4, 2018 at 8:25 am #8117privatejeep
ParticipantUPDATE: I fixed this by adding this code to my child-theme:
function winwar_no_related_posts( $options ) {
if ( !is_singular( ‘post’ ) ) {
$options[‘enabled’] = false;
}
return $options;
}
add_filter( ‘jetpack_relatedposts_filter_options’, ‘winwar_no_related_posts’ );`October 5, 2018 at 6:22 am #8121Support Team
KeymasterHello @privatejeep,
While the workaround that you have added to your child theme works perfectly fine, there is also a setting available in the Jetpack Plugin that lets you disable the related posts display.
Check the URL below for instructions on disabling the related posts on all post types :
https://jetpack.com/support/related-posts/
Best Regards !!
October 5, 2018 at 1:07 pm #8135privatejeep
ParticipantI do not want to use that global shut off option.
Showing related posts in our news blog is important to our site. So It would be silly for me to shut off related posts. Related posts should NOT be show on your trip pages. A great many people use Jetpack. It remains one of the best ways to share posts to our business social media pages from our site’s blog. The same way related trips is important to our trip’s page. Related posts is equally important to our blog’s news page.October 7, 2018 at 4:17 am #8141Support Team
KeymasterHello @privatejeep,
In case you would like to disable the Related Posts module only for the trips page, you can use the following code we have optimized for the purpose :
/** * Disable Jetpack Related Posts on Trips page * * @param array $options * @return void */ function wp_travel_child_cstmremove_jetpack_related_posts( $options ) { $disable_jetpack_related_for_trips = apply_filters( 'wp_travel_disable_jetpack_rp', true ); if ( is_singular( WP_TRAVEL_POST_TYPE ) && $disable_jetpack_related_for_trips ) { $options['enabled'] = false; } return $options; } add_filter( 'jetpack_relatedposts_filter_options', 'wp_travel_child_cstmremove_jetpack_related_posts' );
We will also be adding the code to core plugin code in our next update.
If you have any queries/requests further, please feel free to write back to us.
Best Regards !!
October 7, 2018 at 4:26 am #8142privatejeep
ParticipantVERY NICE! Once again, your product just keep getting better and better!
October 9, 2018 at 5:33 am #8144Support Team
KeymasterHello @privatejeep,
Thank you for the appreciation. Feedbacks from users and suggestions/feature requests is what helps us grow and make our products better with each update.
If you have any issues/queries or requests further, please feel free to write back to us.
Best Regards !!
April 3, 2019 at 12:04 am #13021privatejeep
ParticipantJetpacks’s related is showing on my trips page again. Just the work Related under the trips’s overview text. Can you please finally fix this bug. In the past as stated in this thread I used the child theme code posted to remove this but it no longer is working in the current version of Jetpack. Please tell me how to finally make a way so Jetpack’s related will not show on trip pages but just in my blog.
Example page with the bug: https://www.privatejeep.com/itinerary/horseshoe-dam/
April 3, 2019 at 5:58 am #13048Support Team
KeymasterHello @privatejeep,
We will inspect the issue and come up with the fix if the issue exists.
Hoping for your kind co-operations.
Thank you.
April 3, 2019 at 8:37 am #13055wensolutions
KeymasterHello @privatejeep,
After research, we found the issue is not from the WP Travel plugin but from the JetPack plugin. They have not checked whether the related trip option is enabled or not?
So, as for now the issue can be fixed through the use of code given below:
function wp_travel_remove_jetpack_relatedposts_filter_enabled_for_request( $enabled ) { $disable_jetpack_related_for_trips = apply_filters( 'wp_travel_disable_jetpack_rp', true ); if ( is_singular( WP_TRAVEL_POST_TYPE ) && $disable_jetpack_related_for_trips ) { $enabled = false; } $enabled; } add_filter( 'jetpack_relatedposts_filter_options', 'wp_travel_remove_jetpack_relatedposts_filter_enabled_for_request' );
Hope this helps.
Let us know if there is any issues further.
Thank you.
April 9, 2019 at 1:11 am #13308privatejeep
ParticipantThis code works! It did not display in the email I received correctly. Had to come to the website to grab the proper code without syntax errors.
April 9, 2019 at 6:04 am #13314Support Team
KeymasterHello @privatejeep,
Glad the code worked for you.
Do not forget to post if you have any issues further.
Thank you.
- AuthorPosts
- The forum ‘WP Travel’ is closed to new topics and replies.