I want to make a custom post archieve template where I will display only the custom post by month..
I added this in archieve-news_letter.php
$args = array( 'post_type' => 'news_letter', 'posts_per_page' => 10 );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
/* Include the post format-specific template for the content. If you want to
* this in a child theme then include a file called called content-___.php
* (where ___ is the post format) and that will be used instead.
*/
get_template_part( 'newletter', get_post_format() );
where news_letter
is my custom post...by this I am getting all post without any sorting of month, means I am getting all month post in December link.
to make archieve link I used this:
<li><?php wp_get_archives(array('type' => 'monthly','order'=>'ASC')); ?></li>
any help would be appreciate..
Thanks for your time and sharing knowledge... :)