How do I the name of a city as a variable I can use or call?

This topic contains 3 replies, has 3 voices, and was last updated by  czar 9 years, 6 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #18669

    Greg McEwan Marriott
    Buyer
    Post count: 36

    Hi am trying to automate a weather widget to display the weather for a particlular city, or the displayed city… Is there a shortcode or a global variable for the city, Country i can use to replace the $locationcity in the weather widget?

    #18735

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    you can get the current location with the function

    geodir_get_current_location();

    example:
    add this within the widget code:

    $current_location = geodir_get_current_location(array('echo'=> false));

    and use the variable :

    $current_location;

    wherever needed.

    Thx

    #18769

    Greg McEwan Marriott
    Buyer
    Post count: 36

    🙂 Worked like a DREAM (awesome weather widget) – THANK YOU !!!!!!!!!!!!!!!!!!!!!!!

    #19104

    czar
    Buyer
    Post count: 316

    @greg: You can share this change to ‘awesome weather widget’ and explain how you did it?

    thanks

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

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

Open Support Ticket