Category with post type pagination returns 404

I found a solution! I was able to find a function that modified the query on the category page (https://wordpress.org/support/topic/custom-types-category-pagination-404/#post-1913902 – on the first page toward the bottom, written by: Mark / t31os). Add this to functions.php: add_action( ‘parse_query’,’changept’ ); function changept() { $category = get_query_var(‘cat’); $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; if (is_category() … Read more

How to make WP Query Pagination work

try this: $the_query = new WP_Query( array(‘posts_per_page’=>12, ‘post_type’=>’customers_gallery’, ‘paged’ => get_query_var(‘paged’) ? get_query_var(‘paged’) : 1) ); ?> <?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?> //YOUR CONTENT YOU WANT TO SHOW <?php endwhile; $big = 999999999; // need an unlikely integer echo paginate_links( array( ‘base’ => str_replace( $big, ‘%#%’, get_pagenum_link( $big ) ), … Read more

Not refreshing content pagination on search result

Changed architecture and code a while. Simplified example: normal form, for example with search keyword inside some templete. <form method=”get” id=”search_form” action=”/results”> <input type=”text” name=”search_text” id=”search_text_input” placeholder=”Type something for search”> <button type=”submit”>GO</button> </form> After that i create results.php Here is code: <?php /* Template name: Custom Search */ get_header(); ?> <?php if($_GET[‘search_text’] && !empty($_GET[‘search_text’]) ) … Read more

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