• Resolved bennyjoksch

    (@bennyjoksch)


    Hi there,

    I have never worked with this plugin. This plugin installed and configured by an agency. I wanted to know if this shortcode works Basically.

    [geoip_detect2_show_if property="mostSpecificSubdivision.isoCode" property_value="MO"]XXXXXXXXX[/geoip_detect2_show_if]

    This shortcode is at least stored that way and probably always worked that way.

    Unfortunately now it doesn’t.

    Goal: we would like to run another shortcode in the shortcode:

    Here is the complete snippet:

    [geoip_detect2_show_if property="mostSpecificSubdivision. isoCode" property_value="MO"][gd_listings post_type="gd_event" post_limit="3" add_location_filter="1" sort_by="event_dates_asc" title_tag="h3" layout="3" bottom_pagination="1" skin_id="884" skin_column_gap="30" skin_row_gap="0" category="24"][/geoip_detect2_show_if]

    Can it work like this?

    The inside shortcode gives me results, once it is embedded in the Geolocation IP Detection shortcode, unfortunately no output works

    I thank you already for the help

    More details:

    WordPress: 5.9
    PHP: 7.4.27
    G IP D: Version 5.0.0`

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter bennyjoksch

    (@bennyjoksch)

    Also the Plugin Configuration:

    Data Source:

    Maxmind City or Country Database

    General Options (active):

    – Disable caching a page that contains a shortcode or API call to geo-dependent functions.
    – Enable AJAX endpoint to get the information for the current IP even on cached pages.
    – Add JS Helper functions to all pages.
    – Resolve shortcodes (via AJAX).

    Plugin Author Benjamin Pick

    (@benjamin4)

    Hi,
    yes this should work.

    I’m seeing there a space in

    property=”mostSpecificSubdivision. isoCode”

    Is this space also in your website? Please remove it and try again …

    Thread Starter bennyjoksch

    (@bennyjoksch)

    Hi Benjamin,

    thanks for your quick reply. No, I did not have space in the shortcode on the web page.

    This is the code that is generated. Do you know maybe the reason for the inline style “display-none” ?

    If I take that out, something will be displayed :-)`

    <div class="js-geoip-detect-show-if geoip-hidden" style="display: none;" data-options="{&quot;skip_cache&quot;:false,&quot;lang&quot;:[&quot;en&quot;,&quot;en&quot;],&quot;default&quot;:&quot;&quot;,&quot;property&quot;:&quot;mostSpecificSubdivision.isoCode&quot;,&quot;parsed&quot;:{&quot;op&quot;:&quot;and&quot;,&quot;not&quot;:0,&quot;conditions&quot;:[{&quot;p&quot;:&quot;mostSpecificSubdivision.isoCode&quot;,&quot;v&quot;:&quot;mo&quot;}]}}">

    • This reply was modified 2 years, 9 months ago by bennyjoksch.
    • This reply was modified 2 years, 9 months ago by bennyjoksch.
    Plugin Author Benjamin Pick

    (@benjamin4)

    No the display:none is on purpose, it is removed by the JS script when the condition matches.

    Did you make sure the IPs data is what you expect? You can use the backend lookup form for that (under “Tools”), and/or output the detected value:

    [geoip_detect2 property="mostSpecificSubdivision.isoCode" default="(country could not be detected)"]

    Thread Starter bennyjoksch

    (@bennyjoksch)

    Hi,

    The website operator told me that this worked worldwide. So if someone from Germany went to the website, he still got the closest events displayed (even if they are only in the USA).

    The setup is unchanged and worked for the last 2 years. The only thing new is the website had a US server move and WordPress Core updates.

    So the goal should be that no matter from where in the world a user accesses the website, the closest events should be displayed.

    This is the result of the lookup

    The function $record = geoip_detect2_get_info_from_current_ip(NULL); returns an object:
    See API: PHP for more information.
    
    Lookup duration: 20.35 ms
    Lookup duration when called for the second time in the same request: 0.0820 ms
    
    Value
    $record->city->name	Hechingen
    $record->mostSpecificSubdivision->isoCode	BW
    $record->mostSpecificSubdivision->name	Baden-Württemberg
    $record->country->isoCode	DE
    $record->country->name	Germany
    $record->location->latitude	48.3515000000000014779288903810083866119384765625
    $record->location->longitude	8.963200000000000500222085975110530853271484375
    $record->location->timeZone	Europe/Berlin

    Except for the country code, name & Timezone, all other information provided are incorrect.

    But it should show now Events that are Closest to the Result and I don’t know why this is not working anymore

    Plugin Author Benjamin Pick

    (@benjamin4)

    I would recommend adding a shortcode “if client is not from the USA”:

    [geoip_detect2_show_if property=”country.isoCode” not_property_value=”US”]

    Thread Starter bennyjoksch

    (@bennyjoksch)

    Like So ?

    [geoip_detect2_show_if property="mostSpecificSubdivision.isoCode" property_value="MO"][geoip_detect2_show_if property=”country.isoCode” not_property_value=”US”][gd_listings post_type="gd_event" post_limit="3" add_location_filter="1" sort_by="event_dates_asc" title_tag="h3" layout="3" bottom_pagination="1" skin_id="884" skin_column_gap="30" skin_row_gap="0" category="24"][/geoip_detect2_show_if][/geoip_detect2_show_if]

    Thread Starter bennyjoksch

    (@bennyjoksch)

    Or [geoip_detect2_show_if property=”country.isoCode” not_property_value=”US”][gd_listings post_type="gd_event" post_limit="3" add_location_filter="1" sort_by="event_dates_asc" title_tag="h3" layout="3" bottom_pagination="1" skin_id="884" skin_column_gap="30" skin_row_gap="0" category="24"][/geoip_detect2_show_if]

    And [geoip_detect2_show_if property="mostSpecificSubdivision.isoCode" property_value="MO"][gd_listings post_type="gd_event" post_limit="3" add_location_filter="1" sort_by="event_dates_asc" title_tag="h3" layout="3" bottom_pagination="1" skin_id="884" skin_column_gap="30" skin_row_gap="0" category="24"][/geoip_detect2_show_if][/geoip_detect2_show_if]

    Like This?

    Plugin Author Benjamin Pick

    (@benjamin4)

    You cannot have [geoip_detect2_show_if] inside another [geoip_detect2_show_if]. So probably more the second solutions, two shortcodes next to each other.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Shortcode shows no Data’ is closed to new replies.