mark l chaves
Forum Replies Created
-
Hey @qwik3r,
You should be able to do that by checking for cookies from the first popup (e.g., pum-1) before you open the second (e.g., pum-2).
Here’s an example.
jQuery(document).ready(function ($) { $(document).on('pumBeforeOpen', '#pum-2', function () { if ( !PUM.getCookie( 'pum-1' ) ) { // Check for first popup PUM.preventOpen( 2 ); // Don't open } // if } ); // Listener } ); // jQueryThat’s one idea. There are probably more.
Thanks!
Hello @drunkfox,
Can you make sure you have the Popup Maker plugin installed and activated?
Then, edit your popup. Scroll down to the popup settings. Click Advanced. Click Disable accessibility features.
Here’s what that looks like.
https://share.wppopupmaker.com/NQu7Ewbo
If you’re still not seeing that setting, please submit a support request so we can have a closer look.
https://wppopupmaker.com/support/
Cheers!
Hi @qwik3r,
Popup Maker shouldn’t be caching any popup settings. If you’re seeing that happen when you’re only changing targeting rules, then there might be something else holding on to an old version of the popup (and settings).
If you’re tweaking settings a lot, you might need to temporarily disable all caching (browser, server, WP, CDN, etc.) just so you can test your updates right away.
The asset caching we mentioned before is only improving page speed by going to static copies of minified combined JS and CSS files that Poup Maker uses.
Asset caching is on by default. We give you the option to turn it off if you don’t want it or while you’re developing custom themes or code (so you can test your changes without flushing the cache all the time)
Sorry for any confusion.
We hope that helps.
Have a great day π
Mark
Hey @qwik3r,
Yes. Correct. Our #3 above should read:
3) If a visitor comes on the first of the month and onwards, sees the popup, and clicks the close button, then respect the cookie thatβs set until the first of the next month.
Added: “and onwards”. Sorry for the confusion.
As always test the code to confirm it works for you. Since this is custom code, you’ll be responsible for testing and maintaining it.
But, we’re happy to answer questions and give guidance any time π
Cheers!
- This reply was modified 4 years, 8 months ago by mark l chaves. Reason: Clarification
Hey @narhanju,
We’re going to close this thread since we haven’t heard back from you.
Feel free to post a new issue or contact us directly if you need help with anything else.
https://wppopupmaker.com/support/
Cheers π
Hi @qwik3r,
Just to confirm: You’d like to make sure that popup is seen at least once on the first of every month to all of your visitors?
But, you still want to provide a cookie for that popup so your visitors don’t repeatedly see it after they hit the close button?
If that’s right, you can write custom code to:
1) Check the date.
2) If the date matches the first of the month (date = 1), then clear the cookies for that popup.
3) If a visitor comes on the first of the month, sees the popup, and clicks the close button, respect the cookie that’s set until the first of the next month.
Here’s an example. Note that the date is set to today (11th) for testing purposes.
/** * Add custom JavaScript scripts to the footer of your site theme. * * @since 1.0.0 * * @return void */ function monthly_popup_cookie_purge() { ?> <script type="text/javascript"> jQuery( document ).ready( function ($) { const date = new Date(); // Clear cookies only on a specific date (day of the moth). if ( date.getDate() === 11 ) { // Change this to the date you want. // Don't clear cookies if you've already cleared them today. if ( PUM.getCookie('pum-purged') ) return; // Clear the cookies. PUM.clearCookies( 673 ); // Change the popup ID to yours. // Remember that you've cleared them today. PUM.setCookie( 673, { name: "pum-purged", expires: "+1 day", path: "/" } ); // Change the popup ID to yours. } } ); // jQuery </script> <?php } add_action( 'wp_footer', 'monthly_popup_cookie_purge', 500 ); /** * Add to your child theme's functions.php file or use a code snippets plugin. */Feel free to use and tweak it to your needs.
We hope that helps.
Let us know if we missed something or if you need anything else.
Have a great day π
Mark
Hey @jillyspence,
My pleasure.
I just wanted to use a functions.php file, because I heard that too many plugins slow your site down.
Understood. That’s a pretty general statement (i.e., what is too many plugins?). It also depends on the quality of the plugins you use. It only takes one poorly designed plugin to mess things up π
Anyway, if you know you aren’t going to write many filters and your child theme’s
functions.phpis rock solid, then knock yourself out.BTW, the plugin I use to manage my code snippets does 1 DB query on the front end that takes 0.0007s right now. Just an FYI.
Cheers!
- This reply was modified 4 years, 8 months ago by mark l chaves. Reason: Typo
Hi @redbulb,
I submitted a PR https://github.com/JunglePlugins/Content-Control/pull/50
Cross your fingers π
Have a great weekend!
P.S. Closing thread here. Please follow along on GH.
Forum: Developing with WordPress
In reply to: When PHP variable’s value change.Hi @roelfk7,
You’re welcome. Glad to help π
Shout if you have any follow-up questions.
Have a great weekend!
Hi!
Thanks so much for reaching out.
Can you have a look at this solution?
https://wordpress.org/support/topic/border-text-bloc/#post-14852922
Let us know how that works for you π
Cheers!
Hey @narhanju,
You might want to make sure your code works using Daniel’s instructions first before porting it into your theme. And, you should also follow WordPress standards for enqueueing JS.
Here’s what I suggest:
1) In your HTML, wrap your image with an
<a href=""></>tag that has the link to your download in thehrefproperty.2) Make sure you add
ato your click trigger CSS selector. E.g.,.popmake-244319 a.3) Remove your script from your
index.php. Add it to yourfunctions.phpor use a 3rd-party plugin (like in the video). Here’s an example of what I have working on my test site using Popup Maker, Gravity Forms, and Code Snippets following Daniel’s video./** * Add custom JavaScript for Popup Maker to the footer of your site. */ function gf_download_test() { ?> <script type="text/javascript"> jQuery(document).ready(function ($) { const popupID = 662, // Popup that launches my GF form. hiddenFieldSelector = '#input_1_3'; // Hidden field ID in the GF form. $(document).on('pumBeforeOpen', '#pum-'+popupID, function () { const trigger = $.fn.popmake.last_open_trigger[0], // Link that was clicked to launch the popup. field = $(hiddenFieldSelector); console.log(<code>[PUM] field:</code>); console.log(field); // Sanity check. if (trigger && "" !== trigger.href) { console.log(<code>[PUM] trigger.href: ${trigger.href}</code>); // Sanity check field.val(trigger.href); } // if }); }); </script><?php } add_action( 'wp_footer', 'gf_download_test', 500 ); /** * Add the code above to your child theme's functions.php file or * use a code snippets plugin. */P.S. Please note in the code above, WordPress might substitute my string literals (backticks) in the
console.logs()with<code></code>. I can post the code on GitHub if that’s better for you. Just let me know π- This reply was modified 4 years, 8 months ago by mark l chaves. Reason: Note about unwanted code replacements
- This reply was modified 4 years, 8 months ago by mark l chaves.
- This reply was modified 4 years, 8 months ago by mark l chaves.
Hello @alexjefimov,
We’re going to close this thread since we haven’t heard back from you.
Feel free to post a new issue or contact us directly if you need help with anything else.
https://wppopupmaker.com/support/
Cheers π
Hey @deeperlook,
We’re going to close this thread since we haven’t heard back from you.
Feel free to post a new issue or contact us directly if you need help with anything else.
https://wppopupmaker.com/support/
Cheers π
Hey @rajatag,
We’re going to close this thread since we haven’t heard back from you.
Feel free to post a new issue or contact us directly if you need help with anything else.
https://code-atlantic.com/contact-us/
Cheers :-)`