Title: The Loop question
Last modified: August 20, 2016

---

# The Loop question

 *  Resolved [Alanflamer](https://wordpress.org/support/users/alanflamer/)
 * (@alanflamer)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/the-loop-question-1/)
 * Hello guys, I’m new here. I’m exploring the [Codex](http://codex.wordpress.org/Function_Reference#User_and_Author_Functions)
   looking for tips to aply my template, and I’m stuck.
 * My problem: I’m editing the category.php template file. I have a number of categories
   and I want them to apear in a certain way.
 * The only problem is that I want to style the first post of this page in a different
   way than the other posts. I don’t want to exclude a post by ID or something, 
   I’m only looking for a way to ad some div, automaticaly, to the first post, so
   I can give it a different style.
 * Can anyone of you help? I’m trying, unluckly, to use Query, but when I do that
   my Category page shows all my posts, of every category, and I only whant to aply
   that to the current category of the opened page.
 * If anyone can help, thank you. xD

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/the-loop-question-1/#post-2467232)
 * > I want to style the first post of this page in a different way than the other
   > posts.
 * have you used the forum search (or web search) for this problem?
    it is so common
   that you should be able to get some answers.
 * one way to do this is to add a conditional statement to identify the first post
   in the loop;
 * example: one of my latest posts [http://www.transformationpowertools.com/wordpress/styling-first-post-different](http://www.transformationpowertools.com/wordpress/styling-first-post-different)
 * if this does not help, you could paste the code of your category.php template
   into a [http://pastebin.com/](http://pastebin.com/) and post the link to it here.
   someone might have a look and might be able to suggest a solution.
 *  Thread Starter [Alanflamer](https://wordpress.org/support/users/alanflamer/)
 * (@alanflamer)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/the-loop-question-1/#post-2467293)
 * Thanks for the help. I was using the search on the top of the page, not the specific
   search of the forum. I found various types of solutions, and one in special helped
   a lot.
 * [http://adambrown.info/b/widgets/easy-php-tutorial-for-wordpress-users/first-post-different-from-the-rest/](http://adambrown.info/b/widgets/easy-php-tutorial-for-wordpress-users/first-post-different-from-the-rest/)

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘The Loop question’ is closed to new replies.

## Tags

 * [category template](https://wordpress.org/support/topic-tag/category-template/)
 * [First post](https://wordpress.org/support/topic-tag/first-post/)
 * [loop](https://wordpress.org/support/topic-tag/loop/)

 * 2 replies
 * 2 participants
 * Last reply from: [Alanflamer](https://wordpress.org/support/users/alanflamer/)
 * Last activity: [14 years, 5 months ago](https://wordpress.org/support/topic/the-loop-question-1/#post-2467293)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
