Display random locations in Polpular Locations widget

This topic contains 4 replies, has 3 voices, and was last updated by  refillnotlandfill 4 years, 5 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #518445

    refillnotlandfill
    Expired Member
    Post count: 5

    I am using the Listimia theme along with WordPress 5.3, Geodirectory 2.0.0.70, and Geodirectory Location Manager 2.0.0.22. Unfortunately, I was way too far along in my development when I realized that the theme is using the GD > Locations widget on the homepage in a way that it was apparently never designed to be used. No matter what type of location I choose (city, region, or country), I can only display the first X (whatever Number of Locations I selected) locations of that type, chosen alphabetically. This is of course not much use for a “Popular Location” section on the homepage. While I would ideally be able to select the specific locations to display, an acceptable workaround is to just choose randomly from all of the specified location types. In order to do that, I have had to change line 426 of general-functions.php to

    $main_location_query = "SELECT " . $fields . " FROM " .GEODIR_LOCATIONS_TABLE." WHERE 1=1 " .  $search_query . " GROUP BY $location_args[what] ORDER BY rand() $limit";

    . This works, but is certainly not ideal since I will have to make the same change every time the plugin is updated, and it has the potential to affect other areas of the site, as well. Would it be possible to add a checkbox to the widget settings such as “Randomize locations” and the code to support it? Or am I just missing something and this should already be possible?

    #518449

    Guust
    Moderator
    Post count: 29970

    A valid license is required to view this reply.

    You may need to login

    OR

    Buy either a Membership or valid license for this product.

    Thanks, Team GeoDirectory!

    #518462

    refillnotlandfill
    Expired Member
    Post count: 5

    A valid license is required to view this reply.

    You may need to login

    OR

    Buy either a Membership or valid license for this product.

    Thanks, Team GeoDirectory!

    #518583

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    A valid license is required to view this reply.

    You may need to login

    OR

    Buy either a Membership or valid license for this product.

    Thanks, Team GeoDirectory!

    #518587

    refillnotlandfill
    Expired Member
    Post count: 5

    A valid license is required to view this reply.

    You may need to login

    OR

    Buy either a Membership or valid license for this product.

    Thanks, Team GeoDirectory!

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

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

Open Support Ticket