Support » Themes and Templates » Category.php And Custom Post Types

  • Okay so let me explain what Im trying to do, I am trying to make it so that my custom post type “Employees” which has categories enabled uses a dynamic category page that only lists posts within the current category that you are on.

    its like a wp_query for custom post type & catid but catid = current category that your on.

    I cannot for the life of me understand how the category query works. I’ve looked in countless normal themes and all that I find is a loop.

Viewing 3 replies - 1 through 3 (of 3 total)
  • I think the answer to your question is here:

    >> archive-custom_post_type.php

    I am struggling with this still its not working for me.

    global $thisCat;
    $thisCat = get_category(get_query_var(‘cat’),false);
    // The Loop
    while ( have_posts() ) : the_post();
    	<div id="employee">
    			<div class="pframe"><?php if ( has_post_thumbnail() ) {
    	the_post_thumbnail( array(100,100) );
    } ?></div>
    			<div class="ename"><?php the_title(); ?></div>
    			<div class="eposition">Manager</div>
    			<div class="ecompany">Section A</div>
    			<div class="email"></div>
    			<div class="ext">EXT# 1234</div>
    <?php endwhile;
    // Reset Query
    wp_reset_query(); ?>

    I tried this no avail

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Category.php And Custom Post Types’ is closed to new replies.