Want to permanently remove pagination number page/2/ in WordPress
Want to permanently remove pagination number page/2/ in WordPress
Want to permanently remove pagination number page/2/ in WordPress
Getting infinite scrolling working on my custom template
Load all the posts and hide them exclude 10. If the user scroll to page bottom show more 10. $(‘article’).each((i, el) => { if (i > 9){ $(el).hide(); } }); $(window).scroll(() => { if ((window.innerHeight + window.scrollY) >= document.body.offsetHeight) { $(‘article:hidden’).first().show(); } });
This is known bug. You can read something about this here: https://github.com/Yoast/wordpress-seo/issues/1109 michaelcurry there wrote a solution. Quick Fix – Put this into your functions file. add_action(‘wp_loaded’, ‘remove_actions’); function remove_actions() { remove_action( ‘wp’, array( $GLOBALS[‘wpseo_front’], ‘pagination_overflow_redirect’ ), 99 ); }
I suppose the obvious alternative is having logic in content-page.php that checks to see if it’s paged content and outputs differently if that’s the case. Basically. In content-page.php: get_header(); //WordPress has a global variable for whether a post/page is paginated or not global $paged; // If post/page isn’t paginated if ($paged === 0) { //Do … Read more
I’m assuming you want it to do what happens on Jetpacks’ example without a button, just scroll down and more posts appear until there’s no more? Not sure if this will help, but your code has the wrapper parameter set to false while Jetpack’s example where they have the footer parameter section has it set … Read more
WP_Query has a $post_count variable. http://codex.wordpress.org/Class_Reference/WP_Query#Properties Just pass that with the script using wp_localize_script
If you look at the Action Reference, you can see the order things happen. Note where init is, the query object doesn’t exist until the wp action. // … init └─ widgets_init register_sidebar wp_register_sidebar_widget wp_default_scripts wp_default_styles admin_bar_init add_admin_bar_menus wp_loaded parse_request send_headers parse_query pre_get_posts posts_selection wp // …
offset would skip posts, it sounds like you want the current page number * the number of posts per page- $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; $posts_per_page = $paged * get_option(‘posts_per_page’); $args = array( ‘posts_per_page’ => $posts_per_page ); You’ll need to keep in mind that total number of pages in the query object will … Read more
You never seem to populate the $paged variable with a value. Try adding this before the query (from the codex): if ( get_query_var( ‘paged’ ) ) { $paged = get_query_var( ‘paged’ ); } elseif ( get_query_var( ‘page’ ) ) { $paged = get_query_var( ‘page’ ); } else { $paged = 1; } Also, your “load … Read more