Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter aassddff

    (@aassddff)

    thanks a lot, it works almost OK. the only problem is that is shows posts with every two IDs, for example:
    5739, 5741, 5743, 5745, 5747 …
    could you please show me how to show posts like this:
    5739, 5740, 5741, 5742, 5743 …

    anyway – thanks a lot for your help & code !!

    Thread Starter aassddff

    (@aassddff)

    In my wordpress more than 99,9% of id-s are posts so really I don’t care about few rare situations. All I care about is the performance (I want to use as little resources as it’s possible).

    Could you please write down the code of selecting random post id from my database and I think I will deal with it further.

    Thanks for your reply.

    [ Please do not bump, that’s not permitted here. ]

    Thread Starter aassddff

    (@aassddff)

    @coffee2code:
    Thanks for your help, but this solution works like my previous. When I put this code on my website it’s not loading at all. Just blank screen.

    Mine problem is that I’ve got WordPress with lost of posts (>100k) and random kills execution in php (I think).

    Is this possible to make a loop which choose a number between 1 and numer_of_my_posts and receive a post (link to post actually) with chosen id?

    No need to check whether this id is correct.
    No need to check if we’ve already choose this id.
    That’s all I’m asking for. It would be great if this would be possible.

    And thanks for your help anyway!

    Thread Starter aassddff

    (@aassddff)

    I want random posts without “orderby rand()”.
    In the link that I posted above there was a solution that in author’s opinion should work.

    Thread Starter aassddff

    (@aassddff)

    I don’t know. I’m not a programmer.
    I was told that getting posts from database using “order by rand” is not optimal because everytime it creates temporary table. Whatever.
    Can someone tell me how to show 10 random posts without using the method that I’ve shown above?
    Thanks in advance for your help.

    Thread Starter aassddff

    (@aassddff)

    There is ‘orderby’ => ‘rand’ what is highly not optimal for database.

Viewing 6 replies - 1 through 6 (of 6 total)