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
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 07-30-2012, 03:21 PM   #1
The Dawg
Confirmed User
 
The Dawg's Avatar
 
Join Date: Apr 2002
Location: State Of Bliss
Posts: 2,438
Wordpres Help

On a custom category page how would you write:

Code:
if ($category->cat_ID == $this_category)
I want to change the color of the category button IF it is the current category.
The Dawg is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-30-2012, 03:26 PM   #2
Colmike9
(>^_^)b
 
Colmike9's Avatar
 
Industry Role:
Join Date: Dec 2011
Posts: 7,223
Here's the syntax:
http://codex.wordpress.org/Function_...t_the_category
__________________
Join the BEST cam affiliate program on the internet!
I've referred over $1.7mil in spending this past year, you should join in.
I make a lot more money in the medical field in a lab now, fuck you guys. Don't ask me to come back, but do join Chaturbate in my sig, it still makes bank without me touching shit for years..
Colmike9 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-30-2012, 03:27 PM   #3
mce
Confirmed User
 
mce's Avatar
 
Industry Role:
Join Date: Jun 2012
Location: All Over
Posts: 3,917
Anyone know if there are any CATEGORY-SPECIFIC ad rotator plugins?
__________________

Pay Virtual Assistants Based on RESULTS instead of TIME
STOP getting FUCKED IN THE ASS by your VA
mce is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-30-2012, 03:30 PM   #4
Colmike9
(>^_^)b
 
Colmike9's Avatar
 
Industry Role:
Join Date: Dec 2011
Posts: 7,223
Quote:
Originally Posted by mce View Post
Anyone know if there are any CATEGORY-SPECIFIC ad rotator plugins?
Nah, just code it manually:

<?php if ( is_category( 'CAT1') ): ?>
<!-- Insert code for cat1 ad here -->
CAT1 Code

<?php elseif ( is_category( 'CAT2') ): ?>
<!-- Insert code for cat2 ad here -->
CAT2 Code

<?php else: ?>
<!-- Insert code for generic ad here -->
Generic Ad Code

<?php endif; ?>
__________________
Join the BEST cam affiliate program on the internet!
I've referred over $1.7mil in spending this past year, you should join in.
I make a lot more money in the medical field in a lab now, fuck you guys. Don't ask me to come back, but do join Chaturbate in my sig, it still makes bank without me touching shit for years..
Colmike9 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-30-2012, 03:31 PM   #5
The Dawg
Confirmed User
 
The Dawg's Avatar
 
Join Date: Apr 2002
Location: State Of Bliss
Posts: 2,438
Quote:
Originally Posted by Colmike7 View Post
Yes, I found this too. My menu is loading with all the cats correctly. I want to add a the css code to change the current category to a different color.
The Dawg is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-30-2012, 03:36 PM   #6
Colmike9
(>^_^)b
 
Colmike9's Avatar
 
Industry Role:
Join Date: Dec 2011
Posts: 7,223
Quote:
Originally Posted by The Dawg View Post
Yes, I found this too. My menu is loading with all the cats correctly. I want to add a the css code to change the current category to a different color.
Hm, I'll have to think about that one. I can only think of doing that by overriding the text html based on the category by making a custom category list for the sidebar or maybe by using separate CSS files for each category using 'in_category' like this:


<link rel="stylesheet" href="<?php bloginfo('template_url')?>/default.css" type="text/css" />

<?php
if( in_category( 1 ) )
{
?>
<link rel="stylesheet" href="<?php bloginfo('template_url')?>/cat1.css" type="text/css" />

<?php } elseif ( in_category (2) )
{
?>
<link rel="stylesheet" href="<?php bloginfo('template_url')?>/cat2.css" type="text/css" />

<?php } elseif ( in_category (3) )
{
?>
<link rel="stylesheet" href="<?php bloginfo('template_url')?>/cat3.css" type="text/css" />
<?php } else { ?>

<?php } ?>
__________________
Join the BEST cam affiliate program on the internet!
I've referred over $1.7mil in spending this past year, you should join in.
I make a lot more money in the medical field in a lab now, fuck you guys. Don't ask me to come back, but do join Chaturbate in my sig, it still makes bank without me touching shit for years..
Colmike9 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-30-2012, 03:40 PM   #7
mikesouth
Confirmed User
 
mikesouth's Avatar
 
Industry Role:
Join Date: Jun 2003
Location: My High Horse
Posts: 6,334
adsponsors plugin from coyotesdesigns will do category specific ad rotation

and its free
__________________
Mike South

It's No wonder I took up drugs and alcohol, it's the only way I could dumb myself down enough to cope with the morons in this biz.
mikesouth is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-30-2012, 03:45 PM   #8
mce
Confirmed User
 
mce's Avatar
 
Industry Role:
Join Date: Jun 2012
Location: All Over
Posts: 3,917
Quote:
Originally Posted by mikesouth View Post
adsponsors plugin from coyotesdesigns will do category specific ad rotation

and its free
Thank you so much, Mikesouth and Colmike7
__________________

Pay Virtual Assistants Based on RESULTS instead of TIME
STOP getting FUCKED IN THE ASS by your VA
mce is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-30-2012, 03:59 PM   #9
The Dawg
Confirmed User
 
The Dawg's Avatar
 
Join Date: Apr 2002
Location: State Of Bliss
Posts: 2,438
Quote:
Originally Posted by Colmike7 View Post
Hm, I'll have to think about that one. I can only think of doing that by overriding the text html based on the category by making a custom category list for the sidebar or maybe by using separate CSS files for each category using 'in_category' like this:


<link rel="stylesheet" href="<?php bloginfo('template_url')?>/default.css" type="text/css" />

<?php
if( in_category( 1 ) )
{
?>
<link rel="stylesheet" href="<?php bloginfo('template_url')?>/cat1.css" type="text/css" />

<?php } elseif ( in_category (2) )
{
?>
<link rel="stylesheet" href="<?php bloginfo('template_url')?>/cat2.css" type="text/css" />

<?php } elseif ( in_category (3) )
{
?>
<link rel="stylesheet" href="<?php bloginfo('template_url')?>/cat3.css" type="text/css" />
<?php } else { ?>

<?php } ?>
Thanks.
Thats pretty long stuff there and I'd have to update it every time I added a new category. I got it to work a specific category ID:

Code:
<?php
$args=array(
  'orderby' => 'name',
  'order' => 'ASC'
  );
$categories=get_categories($args);
  foreach($categories as $category) {
if ($category->cat_ID == '4') {
echo '<p style="background-color:#eccad3;"><a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View %s Links" ), $category->name ) . '" ' . '>' . $category->name.'</a> </p> ';
}
else { echo '<p><a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View %s Links" ), $category->name ) . '" ' . '>' . $category->name.'</a> </p> '; }
}
?>
The Dawg is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-30-2012, 04:15 PM   #10
Colmike9
(>^_^)b
 
Colmike9's Avatar
 
Industry Role:
Join Date: Dec 2011
Posts: 7,223
Quote:
Originally Posted by The Dawg View Post
Thanks.
Thats pretty long stuff there and I'd have to update it every time I added a new category. I got it to work a specific category ID:

Code:
<?php
$args=array(
  'orderby' => 'name',
  'order' => 'ASC'
  );
$categories=get_categories($args);
  foreach($categories as $category) {
if ($category->cat_ID == '4') {
echo '<p style="background-color:#eccad3;"><a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View %s Links" ), $category->name ) . '" ' . '>' . $category->name.'</a> </p> ';
}
else { echo '<p><a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View %s Links" ), $category->name ) . '" ' . '>' . $category->name.'</a> </p> '; }
}
?>
Nice
__________________
Join the BEST cam affiliate program on the internet!
I've referred over $1.7mil in spending this past year, you should join in.
I make a lot more money in the medical field in a lab now, fuck you guys. Don't ask me to come back, but do join Chaturbate in my sig, it still makes bank without me touching shit for years..
Colmike9 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-30-2012, 05:08 PM   #11
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,359
Quote:
Originally Posted by The Dawg View Post
On a custom category page how would you write:

Code:
if ($category->cat_ID == $this_category)
I want to change the color of the category button IF it is the current category.
Code:
echo get_category(get_query_var('cat'))->name;
will print out the current category name on the category.php page.
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris 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



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.