Last active
April 1, 2024 06:53
-
-
Save tdmrhn/a965cfb6c843754909792ffc3d8cbb7f to your computer and use it in GitHub Desktop.
Blocksy open account popup on selected page load
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'wp_footer', function () { | |
if ( is_page( array( 'contact', 'my-other-page' ) ) && ! is_user_logged_in() ) {// Add any condition you want like is_shop, is_category etc. | |
?> | |
<script> | |
document.addEventListener('DOMContentLoaded', function() { | |
document.querySelector('.ct-header-account [href="#account-modal"]').click(); | |
}); | |
</script> | |
<?php | |
} | |
}, 100); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment