I am using wp_get_archive()
in category.php
.
If I am on page of category=2
it should show my archives of only that category. However it is for all the categories.
So how can I change the query for wp_get_archive()
that it only redirects to archive template for that specific category
this is the code in my category.php
<?php get_header(); ?>
<?php
$args =array(
'posts_per_page' =>1,
);
$loop = new WP_Query( $args );
if($loop->have_posts()):while ( $loop->have_posts() ): $loop->the_post();
the_content();
endwhile;
endif;
?>
<?php wp_get_archives( array( 'type' => 'daily') ); ?>
and if the same code for archive.php
Aucun commentaire:
Enregistrer un commentaire