Skip to content

Instantly share code, notes, and snippets.

@aligator28
aligator28 / admin-redirect.php
Created February 11, 2017 08:56 — forked from kharissulistiyo/admin-redirect.php
Admin Page Redirection After WordPress Theme Activated
/**
* WordPress snippet
* Admin page redirection
* Put this inside theme setup function
*/
global $pagenow;
if ( is_admin() && 'themes.php' == $pagenow && isset( $_GET['activated'] ) ) {
@aligator28
aligator28 / jquery-scroll-bottom.js
Created January 9, 2017 22:41 — forked from toshimaru/jquery-scroll-bottom.js
Detect the scrolling to bottom of the page using jQuery.
$(window).on("scroll", function() {
var scrollHeight = $(document).height();
var scrollPosition = $(window).height() + $(window).scrollTop();
if ((scrollHeight - scrollPosition) / scrollHeight === 0) {
// when scroll to bottom of the page
}
});