Skip to content

Instantly share code, notes, and snippets.

@jrevillini
Last active July 21, 2019 14:50
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 jrevillini/a0d38709d8526ae197944a5200ab94d8 to your computer and use it in GitHub Desktop.
Save jrevillini/a0d38709d8526ae197944a5200ab94d8 to your computer and use it in GitHub Desktop.
open slidebar after 2 secconds
add_action( 'wp_footer', function () { ?>
<script>
// don't run until main slidebars init has happened to avoid JS error
jQuery( window ).on( 'ocs_after', function () {
// @TODO add cookie test
// @TODO add skip list
// @TODO add config based on body class or something
// the default
setTimeout( function () {
var s = new slidebars();
s.init();
s.open( 'ocs-fteaserslidebar' );
}, 2000 );
} );
</script><?php
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment