Forums

[resolved] code to display the current localtion (8 posts)

  1. bblacklist
    Member
    Posted 9 months ago #

    I need a snippet of code to display the current localtion of my location as city and country name. I want to put it in the header of my site next to the search box. I already have the date...also the time but can't get it to show local..only UTC

    b

  2. Justin Givens
    Member
    Posted 9 months ago #

    So you will want to do <?php echo display_current_location('city'); ?>

  3. bblacklist
    Member
    Posted 9 months ago #

    Thanks mate

  4. glepage
    Member
    Posted 2 months ago #

    Is there a code that will detect the country and display it's currency instead of the location?

  5. Justin Givens
    Member
    Posted 2 months ago #

    Glepage,

    What do you use right now to display the currency for other countries?

  6. glepage
    Member
    Posted 2 months ago #

    @Justin,
    I just put "USD 314". I tried the code above but to no avail. I have also spent time looking for plugins that will accomplish this but they are unfortunately out of date.

    What I am trying to accomplish is to show the users currency for a price: (for example):

    What someone in the UNITED STATES would see:
    NIGHTLY RATE:
    USD 314

    What someone in EUROPE would see:
    NIGHTLY RATE:
    EUR 238 (USD 314)

    What someone in AUSTRALIA would see:
    NIGHTLY RATE:
    AUS 300 (USD 314)

    Any assistance would be greatly appreciated.

    Cheers,
    G

  7. Justin Givens
    Member
    Posted 2 months ago #

    Hey glepage,

    I think you are confused about my plugin. I just display a users current location based on their Google Latitude information.

    have you seen : http://wordpress.org/extend/plugins/geoplugin-currency-shortcode/

    It looks like it might do exactly what you want.

  8. glepage
    Member
    Posted 2 months ago #

    Thanks @Justin,

    Sorry, I forgot, I was trying to add to your code..

    No. Unfortunately, that plugin doesn't work either. And not quite what I am looking for. Thanks again.

    Cheers.

Reply

You must log in to post.

About this Topic