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

add_rewrite_rule and pagination issue

Your first two rewrite rules do not end with $, which indicates that the URL should stop there. So myPage/mySuPage/param1/param2/page/3 would still be matched by the first pattern, because it can just ignored the /page/3 part at the end. The next rewrite rules will then never be used. With my Rewrite analyzer plugin I was … Read more

Custom page-links for paginated posts | wp_link_pages quicktag

This is going to be kind of hackish, but it is possible using an alternate function. Add this to your theme’s functions.php file. function wp_link_pages_titled($args=””) { $defaults = array( ‘before’ => ‘<p>’ . __(‘Pages:’), ‘after’ => ‘</p>’, ‘link_before’ => ”, ‘link_after’ => ”, ‘echo’ => 1 ); $r = wp_parse_args( $args, $defaults ); extract( $r, … Read more

Listing child terms of parent term

When you are on a taxonomy page, you can get the parent from the term being displayed by using the following code with get_queried_object. See get_terms for the objects that are returned $queried_object = get_queried_object(‘term’); $term = $queried_object->parent; To get the taxonomy, you can simply just add $tax = $queried_object->taxonomy; below the code above. This … Read more

How to use pre_get_posts?

Remove all query code from the template and just leave the default loop. In your example code you’re overwriting the query in the template, in the code you pasted in the comments, you’re running an entirely new query. These are both unnecessary when using pre_get_posts. Put your pre_get_posts code in functions.php. You don’t have to … Read more

Pagination on child category returns 404

There are a lot of questions here regarding pagination, it is definitely one of the least understood aspects of how WordPress works internally. To understand why you get 404s, we’ll start by looking at the Action Reference in Codex to see the process WordPress follows for each request. The process begins by loading up the … Read more

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