Web Design Blog
Popular Posts
Categories
Styling the first post of your Wordpress blog
Posted on Wednesday, June 11th, 2008 under Uncategorized by Dustin Brewer.I got several emails when I had published my new site design about how to style only the first post of the blog in WordPress. This tactic can be handy to call out the very first post so that the readers attention is on the most recent topic for your blog. It is actually very easy, and may not be the best PHP in the world but it works perfectly.
Now the only problem with using this method is that you will have every first post on every index page styled this way. I haven’t played around with how to avoid that because that is the way I intended to design it. Perhaps someone has an idea on avoiding that if it is needed.
In your index.php file for your WordPress theme you want to find your post container div (or whatever markup wraps your entire post). In the class area of this post you want to add a space after the first class (assuming you have a first class) and use the following PHP:
<?php if ($post != 'set') { echo 'firstPost'; $post='set'; } ?>
What this PHP will do is check to see if the variable $post is set with the string “set†and if it is not set with that string then it will echo out the class “firstPost†and then set the variable. Once the variable has been set each post afterwards will not echo out that class. Thereby creating a unique class for your first post that you can style however you want.
May be a little sloppy for the PHP gurus reading this— but it works.


[...] Comments [...]
thanks a lot that helped me how to style only the first post of the blog in WordPress. nice site
Hi,
This solution didn’t work for me. Instead, I use this one »
good point you have in there! thanks for sharing with us
[...] the rest of Styling the first post of your WordPress blog (191 [...]
Hi, when I put the code after the .post you will see at my page each post is named firstPost. I use wordpress 2.7, can some one help me?
hi, i dont see the PHP script, i use FF, and IE7!!!
Thanks Dustin. This is a great informative post. I’m gonna follow your advice right now.
Опутеть как интересно, во задвигаете. Класс!
Hi there, If you don’t like topics with many links, just delete this topic.
Thankyou.
72]ÂÕÎÄ íà ÏÎÐÍÎ ÑÀÉÒ
46] ÂÕÎÄ
http://pipiskun.land.ru/xr3/34.jpg http://pipiskun.land.ru/xr3/28.jpg
http://pipiskun.land.ru/xr3/6.jpg http://pipiskun.land.ru/xr3/25.jpg
http://pipiskun.land.ru/xr3/37.jpg http://pipiskun.land.ru/xr3/39.jpg
http://pipiskun.land.ru/xr3/2.jpg http://pipiskun.land.ru/xr3/57.jpg
46] ÏÎÐÍÎ
72]ÑÀÌÎÅ ËÓרÅÅ ÏÎÐÍÓÕÀ
72]xxx âèäåî ïîñìîòðåòü
72]ïîðíî ñòóäåíòêè âèäåî ïðîñìîòð
72]xxx ôèëüì çàãðóçèòü èíòåðíåò-ñàéò
ïîðíî ñàéò ïîñìîòðåòü
ïîðíóõà ñêà÷àòü èíòåðíåò-ñàéò
âèäåî xxx ñêà÷àòü
ïîðíî ôîòî çàãðóçèòü
on-line xxx dvd ñêà÷àòü
ïîðíî ãàëåðåè ñìîòðåòü
ñêà÷àòü ãîëûõ äåâî÷åê
ïîðíî èíöåñò îòåö è äî÷ü
ïîðíî àíèìå õýíòàé
ïîðíî ðîëèêè ñ ðîññèéñêèìè çâ¸çäàìè
ïîðíî ñ ÷óæîé æåíîé
ïîðíî ñåêñ òîëñòûõ
ïîñìîòðåòü âèäåî ñåêñ – ïîðíî ðîëèêè
îðãèÿ – ïîðíî âèäåî ôèëüìû
ãîëûå ëþäè ïàò÷
ãîëûå òåëêè â êîëãîòêàõ
ðóññêîå ãåé âèäåî îíëàéí
ïîðíî âèäåî îíëàéí ìàøè ìàëèíîâñêîé
òðàõ âèäåî îíëàéí
porno video îíëàéí
ýðîòèêà îíëàéí âèäåî
ïîðíî êàòÿ ãóñåâà – ñåêñ âèäåî ðîëèêè
ìèíåò âèäåî – ïîðíî âèäåî ðîëèêè
ñåêñ ñ êîíåì âèäåî îíëàéí
ôîòî æåíùèí – ñåêñ âèäåî
ìîëîäûå äåâóøêè ïîðíî
ïðîñìîòð ïîðíóõè – ïîðíî ðîëèêè
ñìîòðåòü îíëàéí òðàõ ìàëîëåòîê
ñåêñ ìàøèíû ñìîòðåòü îíëàéí
ëåçáèÿíêè îíëàéí
ñêà÷àòü ïîðíî ñ íåãðàìè
ïîðíî â æîïó îíëàéí
ïîðíî ñî ñâåòîé – ñåêñ âèäåî
ëþáëþ æåñòêèé ñåêñ
ïîðíî âèäåî çîî çàãðóçèòü
ïîðíî æåíùèíû – ñåêñ âèäåî ðîëèêè
ïîðíî ðîëèêè ñìîòðåòü ìàìî÷êè
ïðîñìîòð âèäåî ñåêñ ìàøèíàìè
ñïåðìà îíëàéí – ñåêñ ðîëèêè
ñêà÷àòü îðãàçì
ïîðíî ðîëèêè on line
ñìîòðåòü ïîðíî âèäåî ñî çâåçäàìè – ñåêñ âèäåî
ïðîñìîòð ãåé ôèëüìîâ
on-line ãîëóþ dvd ñêà÷àòü
xxx âèäåî ñêà÷àòü ïîðòàë
on-line ãîëàÿ ïîñìîòðåòü
îí-ëàéí ñåêñ âèäåîðîëèê ïðîñìîòð
on-line ãîëàÿ ðîëèê ñìîòðåòü
xxx âèäåî ñêà÷àòü
on-line ñåêñ ðîëèêè ñêà÷àòü èíòåðíåò-ñàéò
on-line ãîëûå ïðîñìîòð
ïîðíî ïîñìîòðåòü ñàéò
èíòåðíåò porno ïðîñìîòð
online ãîëûå dvd ñìîòðåòü
îíëàéí ãîëàÿ ðîëèêè ïðîñìîòð
ñêà÷àòü
online sex ôîòî ïðîñìîòð ïîðòàë
Darmowe ogłoszenia
allergy is awesome… I just want to go and kill my self
What a remarkabel blog post man. Nice share. But I am having problems with this rss feed. I fail to subscribe. Is there any person else experiencing similar issue with your feeds?
thanks for the useful advice