WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. rzul
    Member
    Posted 5 months 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?

    https://wordpress.org/plugins/clean-my-archives/

  2. aliferis
    Member
    Posted 2 months 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
    Member
    Posted 1 month ago #

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

Reply

You must log in to post.

About this Plugin

About this Topic