Remove pagination from WooCommerce product categories on admin edit navigation menus

Based on “Remove Pagination in Appearance -> Menus -> Categories“ answer thread for WordPress categories, you will adapt the answer code to WooCommerce Product Categories. The taxonomy of WooCommerce Product category is product_cat. Is also better to target admin nav menus only. Try the following (untested): add_filter( ‘get_terms_args’, ‘admin_nav_menu_show_all_product_categories’, 10, 2); function admin_nav_menu_show_all_product_categories( $args, $taxonomies … Read more

add spans and characters into paginate_links

The function paginate_links() can return “plain”, “list” and “array” (http://codex.wordpress.org/Function_Reference/paginate_links). Just define the type as array then you’ll be to display it as you want: <?php global $wp_query; $big = 999999999; // need an unlikely integer $paginate_links = paginate_links( array( ‘base’ => str_replace( $big, ‘%#%’, get_pagenum_link( $big ) ), ‘format’ => ‘?paged=%#%’, ‘current’ => max( … Read more

Limit the number of pages created by the paging

This seem to work. Put in your functions.php: add_filter(‘pre_get_posts’, ‘limit_pages’); function limit_pages($query) { $query->max_num_pages = 5; if ($query->query_vars[‘paged’] > 5) { $query->query_vars[‘paged’] = 5; $query->query[‘paged’] = 5; } return $query; } But I guess you would still need some workaround for posts pagination and authors. Hope it helps you a little.

redirect pages with no content, instead of 404 error, using max_num_posts?

If the rest of your function works you just need to add a call to wp_safe_redirect and hook the whole thing into WordPress. I think that the first hook that will have a populated $wp_query is wp. So alter the last part of your function… if($max_page < $paged){ wp_safe_redirect(get_bloginof(‘url’),’301′); } And then add the following … Read more

Comments Pagination as an unordered list

As paginate_comments_links() is pretty much just a already customized version for comments of paginate_links(), see the documentation for a deeper insight, you can use the parameter type for this. paginate_comments_links( array( ‘type’ => ‘list’ ) );

WP_Query pagination not working in admin area

Milo noted that there is no $wp_query object in wp-admin page, so we can get $paged via: $paged = ( $_GET[‘paged’] ) ? $_GET[‘paged’] : 1; Now that we have $paged, we can code our own pagination. I will demonstrate how in its very simplest form. First let’s get maximum pagination pages: $max_pages = $the_query->max_num_pages; … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)