BUG – Related Posts on Trips Page

Homepage Forums WP Travel BUG – Related Posts on Trips Page

This topic contains 13 replies, has 3 voices, and was last updated by  Support Team 3 months, 1 week ago.

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #8113

    privatejeep
    Participant

    There 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:
    Related Posts Bug

    #8115

    Support Team
    Keymaster

    Hello @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!

    #8116

    privatejeep
    Participant

    So 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?

    #8117

    privatejeep
    Participant

    UPDATE: 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’ );`

    #8121

    Support Team
    Keymaster

    Hello @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 !!

    #8135

    privatejeep
    Participant

    I 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.

    #8141

    Support Team
    Keymaster

    Hello @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 !!

    #8142

    privatejeep
    Participant

    VERY NICE! Once again, your product just keep getting better and better!

    #8144

    Support Team
    Keymaster

    Hello @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 !!

    #13021

    privatejeep
    Participant

    Jetpacks’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/

    #13048

    Support Team
    Keymaster

    Hello @privatejeep,

    We will inspect the issue and come up with the fix if the issue exists.

    Hoping for your kind co-operations.

    Thank you.

    #13055

    wensolutions
    Keymaster

    Hello @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.

    #13308

    privatejeep
    Participant

    This 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.

    #13314

    Support Team
    Keymaster

    Hello @privatejeep,

    Glad the code worked for you.

    Do not forget to post if you have any issues further.

    Thank you.

Viewing 14 posts - 1 through 14 (of 14 total)

You must be logged in to reply to this topic.