Moving Change Location Link (very top of themes homepage)

  • Brian
    Brian
    Newbie 86 points
    October 13, 2015 at 8:51 pm

    Hi,

    Is it Feasible or even possible at all to move the Change location link to another location? What JavaScript would be needed to accomplish the move? I was planning on trying it out in the main navigation menu, but I may want to move it elsewhere, what code do I need to move that link?

    Thank you
    Brian


  • Janak
    Super Guru 1,283 points
    October 13, 2015 at 10:58 pm

    Brian, I once moved it to the sidebar in an older version, discussed here:

    "Change Location" button, change the position

    The code may be a bit different now but the idea is the same – you could grab the bit of code by viewing page source or Firebug then paste into a widget.

  • Brian
    Brian
    Newbie 86 points
    October 14, 2015 at 12:28 am

    @Janak

    Do you know of a variable that will display the correct flag based on what the user has selected? If I copy the code directly from the source, I am getting the US flag, but when I change location, the flag does not change.

    Thank you in advance
    Brian

  • Brian
    Brian
    Newbie 86 points
    October 14, 2015 at 12:55 am

    @Janak

    Edit: My mistake, I was looking at the top navigation, not the main menu, so the below answer is not correct:

    It does work that way, the flag does change. It took a page refresh after a couple of minutes and all is good!

    Thank you
    Brian


  • Janak
    Super Guru 1,283 points
    October 14, 2015 at 8:00 am

    That’s great Brian, glad to help.

  • Brian
    Brian
    Newbie 86 points
    October 15, 2015 at 7:28 pm

    @Janak

    Sorry to confuse you Janak on this topic, but what I meant in this post:

    https://www.premiumpress.com/forums/topic/moving-change-location-link-very-top-of-themes-homepage/#post-97689

    was that I thought I had got it, but what I did was look in the original location of the change location link and I saw the flag change, but it did not change in the new location.

    I have found in the framework/class folder, the file class_design.php I see the following code on line 1198 in my file:

    <a href="javascript:void(0);" onclick="GMApMyLocation();" data-toggle="modal" data-target="#MyLocationModal"><div class="flag flag-'.strtolower($country).' wlt_locationflag"></div> '.$CORE->_e(array('widgets','8')).'</a> </li>';

    I have tried to add that into my header.php file in the CT themes directory at the very bottom, but it doesn’t show anything.

    Do you have anyother suggestions as to how I can move the Top Menu (Change Location, Dashboard, Favorites and Logout Links?)

    Thank you
    Brian

  • Brian
    Brian
    Newbie 86 points
    October 15, 2015 at 8:45 pm

    @Janak

    I found my solution:

    <?php echo '<a href="javascript:void(0);" onclick="GMApMyLocation();" data-toggle="modal" data-target="#MyLocationModal"><div class="flag flag-'.strtolower($country).' wlt_locationflag"></div> '.$CORE->_e(array('widgets','8')).'</a></li>'; ?>

    I forgot to add the echo after the opening php tag. 😳

    Edit: I still need to get the flag, I don’t know how to get the flag image. I will try to find it then post here.

    Brian

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

New Business Themes for WordPress 2020

Start your new website today!

View Business Themes