Category.php And Custom Post Types (4 posts)

  1. nickkos
    Posted 2 years ago #

    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.

  2. gerald@WPcustoms
    Posted 2 years ago #

    I think the answer to your question is here:

    >> archive-custom_post_type.php

  3. nickkos
    Posted 2 years ago #

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

  4. nickkos
    Posted 2 years ago #

    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">johnsmith@interplast.com</div>
    			<div class="ext">EXT# 1234</div>
    <?php endwhile;
    // Reset Query
    wp_reset_query(); ?>

    I tried this no avail

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.