GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Programmers: can you do this in Wordpress? (https://gfy.com/showthread.php?t=725570)

clickhappy 04-18-2007 05:42 PM

Programmers: can you do this in Wordpress?
 
Right now the sidebars in my Wordpress blog are all static.
So if someone is on the anal page, they'll see the exact same side bars as if theyre on the cumshot page, the tranny page, the ebony page, etc.

Is there any way I can make it dynamic? So when someone is on the ebony page it shows some ebony banners in my sidebars? And when someone is on the anal page it shows anal banners on the sidebars?

In the url it does say www.mysite.com/anal, www.mysite.com/ebony etc.
So maybe theres a way to pull the category name from the url and have it so that whatever category is showing in the url, will show the approriate banner in the url.

Anyone know how to do this?

k0nr4d 04-18-2007 05:48 PM

Im not sure how wordpress passes in its categories but you could put something along the lines of this in your template
Code:

<?
$category = $_GET[category]; //not sure about this part, might need to explode(); the url and use the last value in the array, as i said i dont know how this is put together in wordpress exactly.
if($category == 'anal') { echo "html code for anal banner"; }
elseif($category == 'ebony') { echo "html code for ebony"; }
else { echo "no matches, generic banner html"; }
?>


clickhappy 04-18-2007 05:49 PM

Quote:

Originally Posted by k0nr4d (Post 12276862)
Im not sure how wordpress passes in its categories but you could put something along the lines of this in your template
Code:

<?
$category = $_GET[category]; //not sure about this part, might need to explode(); the url and use the last value in the array, as i said i dont know how this is put together in wordpress exactly.
if($category == 'anal') { echo "html code for anal banner"; }
elseif($category == 'ebony') { echo "html code for ebony"; }
else { echo "no matches, generic banner html"; }
?>


Aweosme, im going to try that

Thank you!

Jace 04-18-2007 05:56 PM

yup, what he said above, just tell wordpress to check the category before it pulls the sidebar, then it loads a certain sidebar for that category

you can tell it multiple sidebar.php file, and then just duplicate the sidebar.php in your ftp for each sidebar you need

sarettah 04-18-2007 06:26 PM

Quote:

Programmers: can you do this in Wordpress?
Yes, I can.













Next question please :thumbsup

clickhappy 04-19-2007 03:39 AM

I cant get that to work correctly.

fris 04-19-2007 04:49 AM

this is some serious business

BigBen 04-19-2007 05:08 AM

http://codex.wordpress.org/Conditional_Tags

Ace_luffy 04-19-2007 05:16 AM

serious ....:) :) :)

Nicky 04-19-2007 05:35 AM

I want wordpress to load niche specific link trades in the side bar for each category and full list of link trades on main page, can it do that?

beta-tester 04-19-2007 06:04 AM

you can use is_category() function and the combine it with conditional tag....for example if(is_category('teen')) { whatever; }

clickhappy 04-19-2007 10:00 AM

I just can't code.
How much would it cost to hire a programmer to do this for me?

scouser 04-19-2007 10:21 AM

ok, lets say you've got 3 categories,
babe
lesbian
black

this is untested, but should work ... :thumbsup

PHP Code:

<?php
if (is_category('babe')) {
?>
<a href="#"><img src="yourbabeadvert.jpg" alt="" /></a>
<?php
}

if (
is_category('lesbian')) {
?>
<a href="#lesbian"><img src="yourlesbianadvert.jpg" alt="" /></a>
<?php
}


if (
is_category('black')) {
?>
<a href="#black"><img src="yourblackadvert.jpg" alt="" /></a>
<?php
}

?>

As said, http://codex.wordpress.org/Conditional_Tags is where you want to look. Hit me up over icq if you need help. Note- that will display the ad when viewing just the category page itself. To display it when viewing a post in category x, use in_category()

clickhappy 04-19-2007 10:28 AM

Quote:

Originally Posted by deadmoon (Post 12280370)
ok, lets say you've got 3 categories,
babe
lesbian
black

this is untested, but should work ... :thumbsup

PHP Code:

<?php
if (is_category('babe')) {
?>
<a href="#"><img src="yourbabeadvert.jpg" alt="" /></a>
<?php
}

if (
is_category('lesbian')) {
?>
<a href="#lesbian"><img src="yourlesbianadvert.jpg" alt="" /></a>
<?php
}


if (
is_category('black')) {
?>
<a href="#black"><img src="yourblackadvert.jpg" alt="" /></a>
<?php
}

?>

As said, http://codex.wordpress.org/Conditional_Tags is where you want to look. Hit me up over icq if you need help. Note- that will display the ad when viewing just the category page itself. To display it when viewing a post in category x, use in_category()

thank you, All done out. Nice. ill try this

clickhappy 04-19-2007 10:36 AM

Quote:

Originally Posted by deadmoon (Post 12280370)
ok, lets say you've got 3 categories,
babe
lesbian
black

this is untested, but should work ... :thumbsup

PHP Code:

<?php
if (is_category('babe')) {
?>
<a href="#"><img src="yourbabeadvert.jpg" alt="" /></a>
<?php
}

if (
is_category('lesbian')) {
?>
<a href="#lesbian"><img src="yourlesbianadvert.jpg" alt="" /></a>
<?php
}


if (
is_category('black')) {
?>
<a href="#black"><img src="yourblackadvert.jpg" alt="" /></a>
<?php
}

?>

As said, http://codex.wordpress.org/Conditional_Tags is where you want to look. Hit me up over icq if you need help. Note- that will display the ad when viewing just the category page itself. To display it when viewing a post in category x, use in_category()


It works!!
Thank you!

btw, I have a LOT of categories, would this slow down the page to have like 50 categories listed inthis code? is there a way to make it so I dont slow down the page processing?


All times are GMT -7. The time now is 12:38 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123