Random Post Not Working

  • Unknown's avatar

    Appended “?random” to my site address as a link on my site which visitor can click on to be taken to a random post. The link is on each page/post at the bottom of page. However, what happens is that after the first two times the random post link is clicked, the same post keeps coming up, whether I click the link five or fifteen times. Have tried different browsers. Any insight?

    I’d like to avoid using a plugin. My site is: mymorningwalk.com
    The “?random” functionality is from: https://wordpress.com/blog/2007/04/26/get-random/

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    Random works with posts. Athough you have called things test post etc are you sure you haven’t made them as pages/category pages? Your front page is where all the clicks of the random link go to. The usual setup of a site is to have a blog/posts page as the front page and people can scroll down to see the posts. I use the random link on my site (in a widget in the side bar) and it works just fine for me.

  • Unknown's avatar

    Hello. Thanks for the input.

    1.) Yes all of the Test Post x, etc. are posts, not pages or categories. Those posts are listed in the footer area under “Recent” because they show up via the display-posts shortcode used in a widget.

    2.) The front page of the site (or I beleive any WP site) can be a posts page or a static page. I have chosen a static page.

    3.) The posts are assigned a category. Though I think that can not be a limiting factor for use of “?random”, as that would make it un-useful for almost any site.

    The issue does include sometimes the Random link going to the front page, but usually just repeating a post over and over whenever clicked (after the first couple of times).

  • Hello there,

    Many thanks for that additional information.

    However, what happens is that after the first two times the random post link is clicked, the same post keeps coming up

    I’m not able to replicate this behaviour, every time I click I get to a new post.

    Can you tell me what browser you’re using please? Also, can you tell me if this happens in an incognito browser?

    Many thanks.

  • Unknown's avatar

    Hello. I have tried in and out of private mode in Safari and Firefox on a Mac, and on a iPhone.

    Something that is happening leads me to believe the repeating post behavior is not related to a client side issue. After having cleared browser data, I see repeating of, for example, Post C, in Safari, then I try Firefox and same post repeats, and then I try iPhone, and same repeats. If I try again half hour later I will see a new post initially, i.e. Post A, but then same repeating behavior continues across browsers/devices.

    Are you loading site in regular browser or in WP app?

  • We’ve been checking in normal browsers.

    We might be looking at different things though. Just so we’re on the same page, would you please share a screenshot with https://snipboard.io ?

  • Unknown's avatar

    I made a post with a screen recording in case that might be more helpful. At the Bottom of splash page, under “Recent”, click on post named, “Troubleshoot Repeating Post”, and there is the video there. It’s done in Safari, but as I’d mentioned it happens across browsers/devices.

  • Thanks for that video.
    I tested it as well, and, same as my colleagues, I’m not able to replicate the issue. Have a look at my results on Firefox: https://d.pr/i/ikQdWp. Other browsers worked fine as well.
    Could you try it out using a different internet source, like your mobile connection?

    Also, remember that with your plan, you can access Live Chat directly via https://wordpress.com/help/contact. That way, you can get help faster.

  • Unknown's avatar

    I’ve tried mobile connection (on a phone) and different wifi, but I’m getting the same repeating post result as in the video I posted. I did see that it’s working in your video. Mystery. I guess since you’re not able to replicate it, we’ll have to just leave it at that. Thanks.

  • Unknown's avatar

    Update to my last entry: I deleted all the “test post” stuff on my site…however, one last thing in case you recognize something about it…if I’m logged into WP site, and I’m in the “Customize” window—it works properly.

  • The topic ‘Random Post Not Working’ is closed to new replies.