View Single Post
Old 09-27-2009, 01:47 PM  
Jdoughs
Confirmed User
 
Jdoughs's Avatar
 
Industry Role:
Join Date: Mar 2004
Location: Great White North
Posts: 5,794
I spent the last couple days tweaking a dicks/cocks site, the site isnt primarily gay but because of the niche has lots of gay clicks too.

I was lookin for a way to only show gay ads on gay categories, both parent and children cats, and to show a different sidebar/header for any post cat or tag, that was gay.

To display a gay banner in the header on all posts in a descendant of cat 25 (gay), this will also work on tags that have the first post showing from desc of cat 25.

PHP Code:
if (is_home() ) {
    include(
TEMPLATEPATH."/banner.php");
} else if ( 
is_category'gay-dicks' ) || post_is_in_descendant_category25 ) ) {
    include(
TEMPLATEPATH."/bangay.php");
} else {
    include(
TEMPLATEPATH."/banner.php");

And to pull seperate sidebars (only shown on the gay side of the site)

PHP Code:
 if ( in_category'gay-dicks' ) || post_is_in_descendant_category25 ) ) {
    include(
TEMPLATEPATH."/sidebar-gay.php");
} else {
    include(
TEMPLATEPATH."/sidebar.php");

As mentioned above, if_category is not as 'usefull' as in_category. You can use this to completely sanction off and make a category completely relevant and making the site solid for niche landers. The gay traffic never sees anything but stuff tagged as gay or put in the category of gay, likewise for the straight. (I do list the gay category on main page, but never include the posts in the updates, except in the gay pages.)

If that makes any sense, great..lol
__________________
LinkSpun - Premier Adult Link Trading Community - ICQ - 464/\281/\250
Be Seen By New Webmasters/Affiliates * Target out webmasters/affiliates based on niches your sites are for less than $20 a month.
AmeriNOC - Proudly hosted @ AmeriNOC!
Jdoughs is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote