Site logo

Archived topic

Can WP Show Posts be used on category archive page?

3 replies · Started by Greg on June 16, 2021

Viewing posts 1–4 of 4

Hi Greg,

To clarify: You want to change the post loop of the theme from default query to WP Show Posts list?

If so, you can do this but this will require a bit of coding and the use of child theme templates.

You'll have to create a child theme template for the archive pages. We then replace the loop part of the post to this:

 $queriedArchive = get_queried_object();
    $settings = array(
        'taxonomy' => $queriedArchive->taxonomy,
        'tax_term' => $queriedArchive->slug,
    );
    wpsp_display( 1234, $settings );

Where 1234 is the WPSP list you're going to use as the template.

What this does is, it basically turns the WPSP 1234 specified into the template for the post listing for archive pages.

I already have a child theme of the default generatepress pro theme. What part am I going to replace? I've made a copy of the generatepress/archive.php file into my child theme. Do I replace lines 36-42?

while ( have_posts() ) :

	the_post();

	generate_do_template_part( 'archive' );

endwhile;
This archived topic is closed to new replies.