Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am trying to find the best and easiest way of modifying my archive.php template to contain slider on top which slides the 4 first posts and the rest (6) will be displayed beneath as a regular posts.

it should work dynamically with one loop, meaning that if I am clicking on "Previous" or "next" posts and get the paged archive it should work normally and display the same structure starting with the 4 first (in that paged archive) in the slider continuing beneath it with 6 regular posts.

Also I need the name of the category on top but not including other categories which share the same posts!

It seems like a pretty simple Query. the only thing I am concerned bout is how to loop through the slider which contains 2 part: the 4 slider boxes on the right and the faded images on the left.

to better understand what I am trying to achieve here. here is an image I prepared to explain it:

enter image description here

would appreciate any help Thanks. Gil

share|improve this question

1 Answer 1

There are several ways of doing this. You could, for instance, incorporate a counter into your loop and treat the post data with respect to the counter's value.

YOUR QUERY HERE
$my_counter = 0;
while ( have_posts() ) : the_post();
$my_counter++;
if ( $my_counter <= 4 ) {
    SLIDER ACTION
} else {
    REGULAR POST ACTION
}
endwhile;
share|improve this answer
    
Anyway you can add the loop examples (Slider action and Regular posts action) to that code? I am not such an experienced developer. Thanks! –  gil hamer Mar 5 '13 at 22:58
    
WPSE is not a work for me for free site. Your question is over-broad, but this answer covers the main part of the question: how to output the first four posts separately as a slider, followed by the remaining 6 posts. –  Chip Bennett Mar 5 '13 at 23:23
    
I dont intend to use this site as a "work for me for free" as you mentioned. just wanted to have a small example no the whole code. for instance - how do I treat the slider? it has 2 <ul> lists which need to loop: The slider pictures and the text links that change the slider photos. what do I do in that case? any rough example? –  gil hamer Mar 15 '13 at 16:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.