Clean My Archives
Limit archive list to one category? (3 posts)

  1. rzul
    Posted 2 years ago #

    I'm not an expert, but I know enough to get where I need to be. In this case, I use WP as a CMS and blog at the same time. In my archive list, I'd like to display all the blog posts only, not the content posts we've written. In other words, I'd like to display an archive list of everything in my parent category=14.

    In the plugin file, I've managed to change the way the date is displayed ('jS:') and removed the number of comments after post title. But figuring out where in the code I can force this plug-in to only list archives from one category is a little above me. Any suggestions?


  2. aliferis
    Posted 2 years ago #

    Hi rzul

    I did this in the plugin code (see my extra line 'cat' and the cat id...

    /* Set up some arguments to pass to WP_Query. */
    	$args = array(
    		'posts_per_page'      => $attr['limit'],
    		'year'                => $attr['year'],
    		'monthnum'            => $attr['month'],
    		'cat'		=>	'6',
    		'post_type'           => is_array( $attr['post_type'] ) ? $attr['post_type'] : explode( ',', $attr['post_type'] ),

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum's parser.]

  3. rzul
    Posted 2 years ago #

    Thank you! I will try this very soon and let you know what happens.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Clean My Archives
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic