• Resolved abreusky

    (@abreusky)


    Hi guys!

    I’d like to know…

    Is there way to Jetpack’s related posts display random posts if no related posts were found?

    Is there any snippet I could add for Jetpack to do this? ??

    Thanks!

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

    (@jeherve)

    Jetpack Mechanic ??

    You can use the jetpack_relatedposts_filter_hits filter to control the array of post IDs that’s used to return the list of Related Posts. You could consequently check if that array is empty, and add your own post IDs when the array is empty.

    You can find out more about the filter here:
    https://developer.jetpack.com/hooks/jetpack_relatedposts_filter_hits/

    Thread Starter abreusky

    (@abreusky)

    hmm… I don’t think I know how to do this… ??

    Can u give me a link with more examples? :-/

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    You can find an example that will show you how to use the filter at the bottom of the page I linked to earlier.

    If you’re not familiar with PHP, you can ask for help from WordPress professionals here:
    https://jobs.wordpress.net/
    https://jetpack.pro/

    It’s worth noting that once your site has a good amount of content, every post will have Related Posts so that customization will become useless. If some of your posts don’t have Related Posts today, it’s most likely because your site doesn’t have enough content yet, or because of some Jetpack connection issues on your site.

    If you’d like, you can give me some examples of the posts that do not have related posts on your site and I’ll take a closer look.

    Thread Starter abreusky

    (@abreusky)

    Hi, Jeremy.

    Well, I am setting up my blog and I was almost done but I “broke” it and then I had to start everything from scratch, I’ve been the last 3 days remaking everything.

    Before the blog “broke” I had 18 posts and I created several tags and assigned to theses posts, and almost all the 18 were displaying related posts.

    Now I have again 18 posts and several tags, but very few are displaying related posts.

    I don’t know, I’d like to have more of related posts showing up for when I launch my blog as it will be somehow empty, I don’t know…

    If you could have a look and maybe suggest me something to do, just for this first moment…

    This is the link.

    Thanks

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    Most of your content appears to use “Lorem Ipsum” so far; I’d recommend using real content. The categories and tags matter, but the post content is a lot more important. It’s hard to say what posts are related with which on your site, since they all seem to use fake content.

    Could you try to publish real posts, and see if it helps?

    If you want to see posts before you have real content on your site, you should be able to use the filter I mentioned earlier.

    Thread Starter abreusky

    (@abreusky)

    Thank you Jeremy, I will wait till next month, when I “officially” start my blog.

    I got what you said, I think it’s going to work fine.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Display random posts if no related posts were found?’ is closed to new replies.