Pagination on custom post types

Change $loop = new WP_Query( array( ‘post_type’ => ‘portfolio’, ‘posts_per_page’ => -1 ) ); to e.g. $loop = new WP_Query( array( ‘post_type’ => ‘portfolio’, ‘posts_per_page’ => 9 ) ); If you set posts_per_page to -1 you will always pull all available posts. Hence, no pagination will show up since all posts are already shown on … Read more

Changing post per page causing 404 for pagination. Need a redirect htaccess rule

i found a solution with no use of htaccess but using the WP function wp_redirect. copy and past on functions.php function redirect_paginated_404() { if (is_404()) { $url = $_SERVER[‘REQUEST_URI’]; //read the url $search=”/page/”; //chose the word of the url if ( strpos( $url, $search ) !== false ) { //if i find the string /page/ … Read more

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