Skip to content

Instantly share code, notes, and snippets.

@tdmrhn
Last active April 1, 2024 06:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tdmrhn/a965cfb6c843754909792ffc3d8cbb7f to your computer and use it in GitHub Desktop.
Save tdmrhn/a965cfb6c843754909792ffc3d8cbb7f to your computer and use it in GitHub Desktop.
Blocksy open account popup on selected page load
<?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