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.

Post New Thread Reply

Register GFY Rules Calendar Mark Forums Read
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 01-30-2007, 11:36 AM   #1
Young
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?
__________________
★★★
Young is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-30-2007, 11:38 AM   #2
adesadeleer
Registered User
 
Join Date: Dec 2006
Posts: 9
Can you rephrase that ?
adesadeleer is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-30-2007, 11:41 AM   #3
Young
Bland for life
 
Industry Role:
Join Date: Nov 2004
Posts: 10,468
Quote:
Originally Posted by adesadeleer View Post
Can you rephrase that ?
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.
__________________
★★★
Young is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-30-2007, 11:43 AM   #4
DateDoc
Outside looking in.
 
DateDoc's Avatar
 
Industry Role:
Join Date: Feb 2005
Location: To Hell You Ride
Posts: 14,243
DjSap knows WP
__________________
DateDoc is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-30-2007, 11:44 AM   #5
scouser
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...
scouser is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-30-2007, 11:49 AM   #6
scouser
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!)
scouser is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-30-2007, 11:52 AM   #7
scouser
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

Last edited by scouser; 01-30-2007 at 11:53 AM..
scouser is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-30-2007, 11:57 AM   #8
DjSap
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&#37;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
DjSap is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-30-2007, 11:58 AM   #9
Sydney Sin
Confirmed User
 
Join Date: Jan 2007
Posts: 223
bump you
Sydney Sin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-30-2007, 12:00 PM   #10
cachondo
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
cachondo is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-30-2007, 12:02 PM   #11
DjSap
Confirmed User
 
Join Date: Jul 2002
Posts: 3,869
Quote:
Originally Posted by cachondo View Post
And if you separate the posts in categories and show each category in a different area?
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
DjSap is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-30-2007, 12:16 PM   #12
cachondo
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
cachondo is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-30-2007, 12:31 PM   #13
DjSap
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
DjSap is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-30-2007, 11:10 PM   #14
scouser
marketer.
 
Industry Role:
Join Date: Aug 2006
Location: bcn
Posts: 2,280
Quote:
Originally Posted by DjSap View Post
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;}
Yeah. I wasn't really thinking straight, then
scouser is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-30-2007, 11:16 PM   #15
TheSenator
Too lazy to set a custom title
 
TheSenator's Avatar
 
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
TheSenator is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-30-2007, 11:26 PM   #16
jayeff
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
jayeff is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-31-2007, 12:58 AM   #17
Fizzgig
Registered User
 
Fizzgig's Avatar
 
Join Date: Feb 2004
Location: In Your Dreams
Posts: 9,649
I know a LITTLE about Wordpress. I don't know this.
__________________
---'-,-{@ Sassy Grrrl @}-'-,---

Fizzgig is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks
Thread Tools



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.