Results 1 to 3 of 3

Thread: Job Roller - Blog Archive Pages

  1. #1
    Thread Starter
    yourpoc's Avatar
    Join Date
    Aug 2012
    Location
    Dallas, TX
    Posts
    185
    Thanks
    46
    Thanked 6 Times in 6 Posts

    Job Roller - Blog Archive Pages

    The Blog archive pages and the Blog Main page show a different amount of posts.

    To control how many posts are on the blog main page you just go to Settings > General > Reading > blog pages show at most #

    How can I do the same for archived (category, months, years, tags, etc.) pages? By default my archived pages are showing 25 posts. To cut down on load time how can I change that?

    This best code I have found this far is:
    Code:
    function limit_posts_per_archive_page() {
    	if ( is_category() )
    		$limit = 5;
    	elseif ( is_tag() )
    		$limit = 20;
    	else
    		$limit = get_option('posts_per_page');
    
    	set_query_var('posts_per_archive_page', $limit);
    }
    add_filter('pre_get_posts', 'limit_posts_per_archive_page');
    If this is clean where and how can I implement this?

  2. #2
    Thread Starter
    yourpoc's Avatar
    Join Date
    Aug 2012
    Location
    Dallas, TX
    Posts
    185
    Thanks
    46
    Thanked 6 Times in 6 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  3. #3
    jomarkosabel's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    40,958
    Thanks
    169
    Thanked 3,405 Times in 3,276 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    Please help our moderating team work more efficiently by not sending us support questions via PM. You can read more about how AppThemes support works here. However, you can send a PM to follow up and remind me if I missed your support request/thread.

    Thank you and have a nice day.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Archive Category Pages - Show Excerpts
    By domo in forum JobRoller General Discussion
    Replies: 6
    Last Post: November 29th, 2011, 09:09 PM
  2. blog archive widget
    By flash in forum ClassiPress General Discussion
    Replies: 7
    Last Post: August 20th, 2010, 05:36 AM