ThemeShaper Forums » Thematic


How can i make my archive display 100/500/1000 posts?

(6 posts)
  • Started 11 years ago by thexander
  • Latest reply from RayWatkins
  • This topic is resolved
  1. Hello, I'm trying to set a category to display 100-500 posts. Apparently the function below ceases to work if you set the number above 10.

    Can someone please help?

    (This is the function i've tried to do it with, but no dice)

    function my_cat_archive_post_limit() {
      if (is_category('6')) {
        	$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
         	query_posts('cat=6 &showposts=1 &paged=' . $paged );
        	$wp_query->is_archive = true; $wp_query->is_home = false;
    Posted 11 years ago #
  2. @thexander: Looking at the WP Documentation page for query_posts, it seems showposts has been "deprecated in favour of" posts_per_page; not sure if this will make a difference.

    And just out of interest - 100-500 posts seems to be a lot of content. Are you sure your visitors will be able to cope with that amount of data on one page?

    p/s: Just as my personal reference, query_posts tutorial by BinaryMoon.

    Posted 11 years ago #
  3. Interesting, i tried just replacing the words "query_posts" with "posts_per_page" it seemed to break the function.

    Unfortunately, my knowledge of php is not sufficient to really sort this one out.

    If anyone here can help me fix that action code that goes into functions.php, i'd really appreciate it.

    Also, to answer your question, the site owner asked for the "archive" page to not be paged. Its just a list of Post Titles, no content. He wants the archive to be 1 huge page.

    Posted 11 years ago #
  4. @thexander: Sorry I wasn't very clear in my previous post.

    I think I should have emphasised that: showposts has been "deprecated in favour of" posts_per_page.

    Going by Example 3, I wasn't sure if using this in the same functions tag would work?

    function show_all_post_in_cat() {
      if (is_category('1')) {

    Hope it might work for you as it seems to work for me. And thanks for explaining the scenario :)

    Posted 11 years ago #
  5. bingo bango. thank you so much!

    Posted 11 years ago #
  6. I have a related question-- and I have to say that I am likely much less familiar with code that the previous writers... I post music videos on my site each week and each is given the category 'music.' When you click on the category "music" then, for the "music" category archive, I would like to get a list of the titles that you can click on to see the video. Right now, though, all you get is a list of titles followed by the embedding code. Ugly. I think I need to shorten the extract to only the video title but I cannot figure out how to do that...

    I need to know both which file to alter and how to alter it. (The obvious files, archive and archives don't seem to include the extract length.) If you like you can go to my site and see what I mean:



    Posted 11 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.