Category Page Displaying all Pages

Question

My page here: https://blackfreedom.proquest.com/category/civil-rights-and-black-power-movements/activism/selma-demonstrations-and-marches/

is displaying all pages on the site, not just the ones that are associated with this ‘Selma’ category. Which piece am i missing? Should I be using WP_query instead? I’d like to have this dynamic so that all of category pages show the correct pages associated with their cats.

Putting this in my archive.php code:

<ul>

   <?php
        $cat = get_query_var('cat');
        $PozCat = get_category ($this_category);
        $PozCat->id;
        query_posts('&post_type=page”.'.$PozCat->id);
        if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

        <li><a href="<?php the_permalink();?>"><?php the_title(); ?></a></li>
        <p> <?php the_excerpt()?> </p>
    <?php endwhile; endif; ?>
</ul>
0
Joe Kalucki 4 months 0 Answers 8 views 0

Leave an answer