Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

DoodleDogCody on "custom taxonomy pagination"

$
0
0

I have a custom post type called ddc_products and a custom taxonomy called ddc_product_categories.

The products template works just fine for all pages in the pagination. But the taxonomy template is only being read on the first page of products shown. I know this because in my template I force my themes full width layout but the 404 that is returned to me is the default theme layout. Has anyone had this kind of problem before.

Here is the code used in the taxonomy template file.

<?php

remove_action('genesis_loop', 'genesis_do_loop');
add_action('genesis_loop', 'custom_loop');

function custom_loop() {

	$term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
	$id = $term->name;

	$args = (array(
		'post_type'    => array( 'ddc_products' ),
		'ddc_product_categories' => $id,
	));

	genesis_custom_loop( $args );

}

remove_action('genesis_entry_content', 'genesis_do_post_content');
add_action('genesis_entry_content', 'ddc_products_content', 1);

function ddc_products_content() { ?>

	<a href="<?php the_permalink() ?>"><?php the_post_thumbnail('thumbnail'); ?></a>

<?php }

remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
remove_action( 'genesis_entry_footer', 'genesis_post_meta' );

add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );

genesis();

Yes, this is using a genesis theme. But even when switching to the default 2014 the taxonomy page isn't working correctly


Viewing all articles
Browse latest Browse all 8245

Trending Articles