• Joel G Goodman

    (@asilentthing)


    Seeing a bunch of these and have tried everything listed in the other threads. Having the same issue on a client site hosted with WP Engine. Related Posts is not displaying anything, and is instead emitting this comment: <!-- Jetpack Related Posts is not supported in this context. -->

    I’ve followed the Jetpack RP docs and used a filter to keep it from auto-emitting after the_content() and am using the provided shortcode to emit it elsewhere. The Jetpack plugin tells me the site is having issue connecting to the Jetpack service when I debug, yet everything else is working fine and turning off plugins doesn’t fix anything.

Viewing 15 replies - 1 through 15 (of 16 total)
  • Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    Could you tell me more about where you’ve added the shortcode? It should be added inside the loop, or it won’t work.

    Thread Starter Joel G Goodman

    (@asilentthing)

    After reading a bunch of other people’s issues I figured it needed to be inside the loop (it’d help if the docs mentioned that, but they don’t!). So it is within the Loop. But still provides the same context comment.

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    it needed to be inside the loop (it’d help if the docs mentioned that, but they don’t!)

    Thanks for the feedback. I’ve updated the docs to make that clear.

    So it is within the Loop. But still provides the same context comment.

    Could you tell me more, or post your code here via Pastebin maybe, so I can take a closer look?

    Thanks!

    Thread Starter Joel G Goodman

    (@asilentthing)

    Sure. You can take a look at an example post here.

    Code I’ve used is here: https://pastebin.com/QyW6FEPa — it’s pulled pretty much directly from the official docs.

    I’ve done this before with no issues, and kind of don’t know what to look at next after doing all the normal WP compatibility checks.

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    Could you send me the contents of content-single.php and parts/news/related-posts.php as well?

    Thread Starter Joel G Goodman

    (@asilentthing)

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    Thanks! I can’t immediately see what’s wrong here. Do you experience similar issues when moving the do_shortcode() call inside content-single.php?

    Could you also try to add the shortcode directly inside one of your posts’ content, and let me know if it works there?

    Thanks!

    Thread Starter Joel G Goodman

    (@asilentthing)

    I’ve got the shortcode inline on this page for you. No html comment, but there is an empty div.

    I also have it now directly in content-single.php for you… again, no longer an “out of context” error comment, but there is an empty div.

    Can supply an advanced debug log (in case it helps).

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    It looks like there are no related posts registered for that specific post.

    Could you try to install and activate this small plugin, by going to Plugins > Add New > Upload in your dashboard:
    https://github.com/automattic/jetpack-addons/archive/public-related-posts.zip

    Once you’ve activated the plugin, try to synchronize your posts again by going to this page, selecting your site, and scrolling down to the bottom of the page:
    https://wordpress.com/settings/general/

    If the Related Posts start appearing, you can deactivate and delete this small plugin.

    Let me know if it helps.

    Thread Starter Joel G Goodman

    (@asilentthing)

    hey @jeherve – sync has been running for about 24 hours now but still not seeing any change.

    Thread Starter Joel G Goodman

    (@asilentthing)

    So this is what’s weird, in Customizer it shows related posts (Screenshot: https://brvry.co/5xBT/2tDTD2yb ), but live it does not.

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    sync has been running for about 24 hours now but still not seeing any change.

    This is odd. I can see that sync completed, and we have Related Posts results on our end for this post. You can check yourself by querying the WordPress.com REST API directly, like so:
    curl -XPOST https://public-api.wordpress.com/rest/v1/sites/124936391/posts/4201/related

    You can see the results here:
    https://gist.github.com/jeherve/7f0716b5978ba788a27f86bf13761b85

    However, the results aren’t displayed on your site yet. Those results are only cached for 12 hours by default so they should have appeared already. They don’t appear right now, so I wonder if this could be caused by some additional caching on your site. Could you try to flush your WPEngine cache and let me know if it helps?

    in Customizer it shows related posts (Screenshot: https://brvry.co/5xBT/2tDTD2yb ),

    Those are fake, just meant to show you a preview of how Related Posts will look like on your site.

    Thread Starter Joel G Goodman

    (@asilentthing)

    Could you try to flush your WPEngine cache and let me know if it helps?

    Done… not seeing any change.

    Those are fake, just meant to show you a preview of how Related Posts will look like on your site.

    Hah! Good to know ??

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    That’s really odd. I’ve asked one of my colleagues in charge of Related Posts to take a look and I’ll let you know as soon as we have an answer for you!

    Plugin Contributor hypertextranch

    (@hypertextranch)

    @asilentthing That is quite odd, I don’t see anything obviously wrong with either this site in our Elasticsearch cluster nor anything that would be a problem given the pastebin contents. Do you happen to have any filters in place to customize related posts as detailed here?

    https://jetpack.com/support/related-posts/customize-related-posts/

    Also it could really help us debug the issue if we are able to capture the full request and response to the WPCOM servers for related post queries so can you capture both the $body and $response vars here using something like file_put_contents() or error_log()?

    https://github.com/Automattic/jetpack/blob/18d65bb/modules/related-posts/jetpack-related-posts.php#L1241-L1249

    Thanks!

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘RP not displaying – “not supported in this context” comment’ is closed to new replies.