List Random

This topic contains 11 replies, has 3 voices, and was last updated by  Alex Rollin 4 years, 2 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #534892

    Pedro Perez
    Free User
    Post count: 196

    Hello!
    Is there any way that the ad listing is random every time you enter the site or refresh the page?
    Thank you!

    #534894

    Kor
    Moderator
    Post count: 16516

    Hi Pedro,

    Thanks for your post. You can use some of the random “sorting” options as explained here https://wpgeodirectory.com/docs-v2/design/gd-listings/#options to achieve what you needed there.

    #534896

    Alex Rollin
    Moderator
    Post count: 27815
    #534907

    Pedro Perez
    Free User
    Post count: 196

    Thank you very much Kor and Alex, I have investigated with the links they sent and managed to solve it with:

    add_filter(‘geodir_rand_seed’,’__return_false’); // Upon refresh

    I have a question with the following message next message, which appears with the code?
    … (Only recommended to try)
    Is there a problem using this setting?

    Thank you

    #534927

    Alex Rollin
    Moderator
    Post count: 27815

    We do not recommend that you do this random refresh on every load.

    #534928

    Pedro Perez
    Free User
    Post count: 196

    Why?

    #535041

    Alex Rollin
    Moderator
    Post count: 27815

    Because it is not necessary, listings will refresh every 24 hours on random settings. If you have thousands of listings, re-ordering them 20 times a second seems like a needless performance impact.

    #535151

    Pedro Perez
    Free User
    Post count: 196

    Thanks for explaining!
    I understand that it is for performance when having thousands of publications, but I imagine that if the project is smaller, approximately 500 publications, it should not affect performance as much.

    For me, the random configuration of lists was very useful, since the idea was to show different announcements on the cover each time.

    They should consider some solution so that it can be listed randomly, without impacting performance!

    Thank you so much!
    They do a great job !!!

    #535187

    Pedro Perez
    Free User
    Post count: 196

    Where do I add this code so that the results of listing a category are also listed randomly?

    add_filter (‘geodir_rand_seed’, ‘__ return_false’); // Al actualizar

    Currently it serves to randomly display the cover ads!

    #535251

    Alex Rollin
    Moderator
    Post count: 27815

    Do you mean categories displayed with GD Categories? Or something else?

    #535270

    Pedro Perez
    Free User
    Post count: 196

    Attached image!
    Here I need it to be listed randomly.
    Can you use the same code above? or do we have to modify it? where is it added
    Thank you!

    #535396

    Alex Rollin
    Moderator
    Post count: 27815

    Yes, the code above, with the code snippets plugin:

    https://wpgeodirectory.com/docs-v2/faq/customizing/#custom-code

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

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket