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 edit this code to get the categories in achieve page?

first thing that i notice, is that you use some obscure WP loop markup foreach( $myposts as $post ) : setup_postdata($post); Please loop with standard markup an WP_Query class <?php $query = new WP_Query( $args ); ?> <?php if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); ?> https://codex.wordpress.org/The_Loop Next thing, that is … Read more

How to display certain category in the loop from WordPress default post type?

Of course it displays all posts… You create your own custom WP_Query, but then you ignore it and use global one 😉 Here’s the correct code: <?php $args = array( ‘post_type’ => ‘post’, ‘category_name’ => ‘wedding-venue’, ‘posts_per_page’ => 8, ‘facetwp’ => true, ); $query = new WP_Query( $args ); ?> <?php if ( $query->have_posts() ) … Read more

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