WordPress.org

Forums

custom taxonomy results only retrieve 'post' post_type (3 posts)

  1. Charles E. Frees-Melvin
    Member
    Posted 4 years ago #

    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 http://cefm.ca/2010/03/wordcamp-toronto-2010/img_0163/ has a 'person' tax tagged as Mathieu Yuill but http://cefm.ca/people/mathieu-yuill/ 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;
    query_posts(
    	array_merge(
    		array('posts_per_page' => 12),
    		$wp_query->query
    	)
    ); ?>
    
    <?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>
    			<span>
    			<?php echo term_description( '', get_query_var( 'taxonomy' ) ); ?>
    			</span>
    		</div>
    
    <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>
    			</dt>
    				<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>
    				</dd></dl>
    
    	<?php endwhile; ?>
    
    <br style='clear: both;' />
    		</div>
    
    	<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; ?>
    	</div>
    
    <?php else : ?>
    
    	<p>Sorry, but there are no photos of that person.</p>
    
    <?php endif; ?>
    
    </div>
    
    <?php get_sidebar(); ?>
    
    </div>
    
    <?php get_footer(); ?>
  2. Charles E. Frees-Melvin
    Member
    Posted 4 years ago #

    I've tried using a filter but i am having no success yet.

  3. Charles E. Frees-Melvin
    Member
    Posted 4 years ago #

    Okay I got it to work with 'post_status' => publish but paging is not working.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.