Pagination gives 404 error

Have you tried this? I had gotten the same problem before. I did these steps, and it works for me. I use this code in my functions.php // New method of WordPress Query since 3.4.1 if ( ! function_exists( ‘ucc_add_cpts_to_pre_get_posts’ ) ) { function ucc_add_cpts_to_pre_get_posts( $query ) { if ( $query->is_main_query() && ! is_post_type_archive() && … Read more

Where is the best part to hijack or catch a potential 404

It’s not possible to catch a non–match to template in WP because it will always match some template. The very last template it will fall back to will simply be index.php, the most generic one in template hierarchy. In general the appropriate hook for such logic is typically template_redirect in template-loader.php. At this point the … Read more

removed index.php now all pages 404

If you want to remove the index.php from your URL structure, then using this rewrite rule (assuming you’re using Apache, from your question) in your .htaccess will help. # BEGIN WordPress RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] # END WordPress Then, flush permalinks by either using WP-CLI … Read more

Result of Custom WP_Query appears on 404 Page (but result are found!)

I found out its because I used a Input with name=”name” which caused this issue. I believe the name ‘name’ is a keyword in wordpress/php. I replaced the ‘name’ to ‘personname’ then it works as charm. … <input name=”personname” type=”text” value=”” /> … $_POST[‘gsdname’] // multiple time in my code … Best regards Floh

category/category_name pagination 404 error

In the template used for category archives you should have no use for new WP_Query. For all the main templates that WordPress loads itself for post archives, WordPress has already queried the correct posts, so you don’t need to query them again with WP_Query. For these templates, it’s the template’s job just to display those … Read more

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