|
|
|
||||
|
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() |
|
|||||||
| Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
|
Thread Tools |
|
|
#1 |
|
Bland for life
Industry Role:
Join Date: Nov 2004
Posts: 10,468
|
Who here knows a little bit about Wordpress?
Lets say that you have 2 posts in a loop in order to have alternating looks for your posts.
How does Wordpress handle this? Will it work?
__________________
★★★
|
|
|
|
|
|
#2 |
|
Registered User
Join Date: Dec 2006
Posts: 9
|
Can you rephrase that ?
|
|
|
|
|
|
#3 |
|
Bland for life
Industry Role:
Join Date: Nov 2004
Posts: 10,468
|
I'd like my posts spread across different areas of my layout instead of the classic blog like feel. This is achieved on other sites like Kineda.com using Wordpress.
I want to know how I can play with the loop in order to achieve this.
__________________
★★★
|
|
|
|
|
|
#4 |
|
Outside looking in.
Industry Role:
Join Date: Feb 2005
Location: To Hell You Ride
Posts: 14,243
|
DjSap knows WP
__________________
|
|
|
|
|
|
#5 |
|
marketer.
Industry Role:
Join Date: Aug 2006
Location: bcn
Posts: 2,280
|
Like
POST 1 POST 2 And (as an example) POST 1 has black background, POST 2 has red back ground? I am sure there is a better way, and i haven't tested it, but you could try this: <table style="background:<?php if ($currentbg == "#000000") $currentbg = "yellow"; else { $currentbg = "#000000" } echo $currentbg; ?>">POST</table> And it would kind of do it for you. Sorry if it doesn't make sense. been up for about 27 hours so far... |
|
|
|
|
|
#6 |
|
marketer.
Industry Role:
Join Date: Aug 2006
Location: bcn
Posts: 2,280
|
Actually, ignore my last post. Seems I read what you said, and just came up with my own idea of what you wanted. Sorry! (I need to go sleep now!)
|
|
|
|
|
|
#7 |
|
marketer.
Industry Role:
Join Date: Aug 2006
Location: bcn
Posts: 2,280
|
But btw, as it is in a loop, just do a counter, and do something like this:
$counter = 0; while(whatever) { if ($counter == 0) { echo "<tr>"; } echo "<td>post</td>"; if ($counter == 2) { echo "</tr>"; $counter = -1; //to make up for the counter++ below } $counter++; } // next bit fixes it up, incase it just ends in <tr><td>post</td> if ($counter == 1 || $counter == 2) { if ($counter == 1) { echo "<td></td>"; } echo "</tr>"; } } something like that, anyway. and add <table>/</table>. that is if it is in a table, ofcourse |
|
|
|
|
|
#8 |
|
Confirmed User
Join Date: Jul 2002
Posts: 3,869
|
That's a very bulky way of doing it
At the top of the page you put: <?$i;?> Then in index.php you sorround the post with this div: <div class="<?=($i%2)?"bg1":"bg2";$i++;?>"> In your style sheet you put: .bg1 {background-color: #FFF;} .bg2 {background-color: #000;}
__________________
Blog Themes, TGP Design, Writing Services, Grunt Work ICQ: 66871495 |
|
|
|
|
|
#9 |
|
Confirmed User
Join Date: Jan 2007
Posts: 223
|
bump you
|
|
|
|
|
|
#10 |
|
Confirmed User
Industry Role:
Join Date: Sep 2004
Location: Valencia (Spain)
Posts: 808
|
And if you separate the posts in categories and show each category in a different area?
__________________
medianetpay.com |
|
|
|
|
|
#11 |
|
Confirmed User
Join Date: Jul 2002
Posts: 3,869
|
You want a different bg for each category on the front page or a different bg for each category in the category page?
__________________
Blog Themes, TGP Design, Writing Services, Grunt Work ICQ: 66871495 |
|
|
|
|
|
#12 |
|
Confirmed User
Industry Role:
Join Date: Sep 2004
Location: Valencia (Spain)
Posts: 808
|
I think he would like put news into different areas of the index such kineda.com
You can't for example in left shows news of category1 and in right shows news of category 2?
__________________
medianetpay.com |
|
|
|
|
|
#13 |
|
Confirmed User
Join Date: Jul 2002
Posts: 3,869
|
You can do that but it takes some time.
__________________
Blog Themes, TGP Design, Writing Services, Grunt Work ICQ: 66871495 |
|
|
|
|
|
#14 | |
|
marketer.
Industry Role:
Join Date: Aug 2006
Location: bcn
Posts: 2,280
|
Quote:
|
|
|
|
|
|
|
#15 |
|
Too lazy to set a custom title
Industry Role:
Join Date: Feb 2003
Location: NJ
Posts: 13,337
|
Why can't people just make good original blogs the way they were meant to be. KISS is the principle I use and it has brought fortunes.
There is no short cuts unless you are a ruthless asshole that usually whines up dead.
__________________
ISeekGirls.com since 2005 |
|
|
|
|
|
#16 |
|
Confirmed User
Join Date: May 2001
Posts: 2,944
|
If I understand what you want correctly: areaA=a category and areaB=another category, query_posts() should do it:
http://codex.wordpress.org/Template_Tags/query_posts Two snags. The first that you would need a counter, which only ticked up when the category matched the one you were looking for, but that is easily adapted from one of the previous posts, if not explained on the page I linked to. The second is that you would need multiple loops, as explained here: http://codex.wordpress.org/The_Loop |
|
|
|
|
|
#17 |
|
Registered User
Join Date: Feb 2004
Location: In Your Dreams
Posts: 9,649
|
I know a LITTLE about Wordpress. I don't know this.
|
|
|
|