views:

16

answers:

1

Hi,

I have set my wordpress blog's frontpage to show only three posts. On the archive.php template, when the posts of a tag are viewed, I want to show 10 results.

How do I do this?

I tried this php code. But instead of only showing the posts with a certain tag, it queries all recent posts.

//in archive.php (before the loop)
query_posts('posts_per_page=10');
+1  A: 

Just append the query with a tag parameter (as shown here: http://codex.wordpress.org/Function_Reference/query_posts#Tag_Parameters):

query_posts('posts_per_page=10&tag=your_desired_tag');

EDIT: If you use this within a function you can also just append your limit to the original query like this:

function my_archive_loop($content) {
    global $query_string;
    query_posts($query_string . "&posts_per_page=10"); 
}

The variable $query_string should than include all the default parameters like the current tag, category, year or whatever archive page you are viewing.

Kau-Boy
hmm, okay. And what is the best way to get the tag of the archive page? Because I don't want to use a get parameter.
reggie
See my edit for one possible solution. Is that what you need?
Kau-Boy