Support » Fixing WordPress » custom taxonomy results only retrieve 'post' post_type

  • I’m running into an issue where WP is not returning any results of a custom taxonomy that is not the post type ‘post’ where it is listed as a tax from ‘attachment:image’ and should have results, if i tag a post with it only the post returns.

    As an example has a ‘person’ tax tagged as Mathieu Yuill but returns no results. This used to work in 2.9.

    My taxonomy-people.php file is a follows:

    <?php get_header(); ?>
    <div id="contentWrapper">
    	<div id="contentArea">
    <?php global $wp_query;
    		array('posts_per_page' => 12),
    ); ?>
    <?php if (have_posts()) : ?>
    	<?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
    		<div class="contentHeader">
    			<h3>Photos of <?php $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); echo $term->name; ?></h3>
    			<?php echo term_description( '', get_query_var( 'taxonomy' ) ); ?>
    <div id='gallery-1' class='gallery'>
    	<?php while (have_posts()): the_post(); ?>
    	<dl class='gallery-item'>
    			<dt class='gallery-icon'>
    				<a href='<?php the_permalink() ?>' title='<?php the_title(); ?>'><?php echo wp_get_attachment_image( '','thumbnail' ); ?></a>
    				<dd class='gallery-caption'>
    				<a href="<?php the_permalink() ?>"><strong><?php the_title(); ?></strong></a><br />
    				<a href="<?php echo get_permalink($post->post_parent); ?>" rev="attachment"><?php echo get_the_title($post->post_parent); ?> </a>
    	<?php endwhile; ?>
    <br style='clear: both;' />
    	<div id="pageNavigation">
    		<?php if(function_exists('wp_pagenavi')): ?>
    			<?php wp_pagenavi() ?>
    		<?php else : ?>
    			<span id="newerEntries"><?php previous_posts_link('Newer Entries'); ?></span>
    			<span id="olderEntries"><?php next_posts_link('Older Entries'); ?></span>
    		<?php endif; ?>
    <?php else : ?>
    	<p>Sorry, but there are no photos of that person.</p>
    <?php endif; ?>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘custom taxonomy results only retrieve 'post' post_type’ is closed to new replies.