How to get current page ID outside the loop?
Try global $post; echo $post->ID; or (I don’t know the difference) global $wp_query; echo $wp_query->post->ID;
Try global $post; echo $post->ID; or (I don’t know the difference) global $wp_query; echo $wp_query->post->ID;
Use the global $pagenow, which is a common global set by WordPress at runtime: if ( $GLOBALS[‘pagenow’] === ‘wp-login.php’ ) { // We’re on the login page! } You can also check the type of login page, for example registration: if ( $GLOBALS[‘pagenow’] === ‘wp-login.php’ && ! empty( $_REQUEST[‘action’] ) && $_REQUEST[‘action’] === ‘register’ ) … Read more
Your best bet is to use a combination of JS waypoint libraries with the WP Rest API. When element is visible, fetch content and display. Pretty simple. Instead of the <nextpage> you could also wrap this in a custom shortcode but this is primarily a JS problem, not really a WP issue.