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 do I display the grand child items of a taxonomy term?

I managed to answer this question myself by adding get_queried_object()->term_id; instead of the taxonomy terms ID. It now outputs all the grandchild taxonomy terms for the current taxonomy term. Here is my updated working code: $term_id = get_queried_object()->term_id; $taxonomy_name=”product_range”; $term_children = get_term_children( $term_id, $taxonomy_name ); echo ‘<ul>’; foreach ( $term_children as $child ) { $term … Read more