• Resolved Shaun Kardinal

    (@shauniqua)


    Hello. Wonderful plugin! We’re using the premium plugin to load popups on specific posts, post types, etc. However, a new revision of our site uses ajax to load everything within a div inside the body, so the header/footer is never reloaded. Popups work when a user lands on that specific post, post type, etc—but not if they navigate there by way of the homepage or any other landing. We’d hoped that the Ajax Mode would clear this up in a click, but knew that was a long shot.

    Is there a way to hook into the plugin within our own ajax.load? Perhaps we can call a js function or relocate the plugin files to an area within the div?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Damian

    (@timersys)

    Hi @shauniqua,
    first let me tell you for next time that premium users can get support on https://timersys.com/support . We will answer much faster in there as it’s monitored all the time.

    Regarding your issue you could use javascript as you mentioned. Depending on the popup ID you can open popups programmatically like this:
    https://gist.github.com/timersys/a8568e1848a49ae2fe0c

    Regarding moving the content, that could work (theoretically speaking). You need to get a hook of the theme to print content, for this example I will use the post content, but moving it later down would be better.

    // place this in functions.php
    $popup = SocialPopup::get_instance();
    remove_action('wp_footer', array( $popup, 'print_boxes'),1 );
    add_action('the_content', array( $popup, 'print_boxes'), 999 );

    Give it a try and let me know

    Thread Starter Shaun Kardinal

    (@shauniqua)

    thank you Damian! that worked like a dream. for anyone else who stumbles on this, i used the functions.php solution thusly:

    // move popup plugin from footer to ajax wrapper
    $popup = SocialPopup::get_instance();
    remove_action('wp_footer', array( $popup, 'print_boxes'), 1 );
    add_action('popup_in_body', array( $popup, 'print_boxes'), 999 );

    then in my template, just before closing the ajax.load div, i added a custom action

    <?php do_action( 'popup_in_body' ); ?>

    voila!

    Thread Starter Shaun Kardinal

    (@shauniqua)

    ok for some reason that worked like a dream ONCE then stopped working altogether. not sure what is happening now. is there also a js function i need to trigger on.load to check for the popup content?

    Plugin Author Damian

    (@timersys)

    Hi @shauniqua, sorry for the delay, as mentioned earlier please use premium support to get faster responses as this forum is not monitored 24h.

    Popup uses cookies for closing and conversion. So if you closed the popup it won’t show again until the time pass that you set in your closing cookie.
    To display the popup again you can:
    1) Clear your browser cookies
    2) Enable test mode and be logged as an admin.

    Regards

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘popup with ajax site’ is closed to new replies.