Show X if category Show X if this category ? ? ? Wordpress ? ? ?

Discussion in 'WordPress' started by locals, Jun 23, 2009.

  1. #1
    Hi i would like to add some thing for each specific category in one of my wordpress themes.

    I have been having troubles getting this to work because i dont quite know else if codes and just copying from my sidebar.php page and changing the if is home code to one of my categories doesnt work :eek:

    So what i would like is to be able to edit my single.php page so on the pages that display my content i can display certain things for that category.

    So like if i have a bikes category and a pizza category i can add a special advertising code to both for their own advertisments



    if category bikes
    this will be my bikes ads

    if category pizza
    this will be my pizza ads

    if category auctions
    this will be my auction ads



    THANKS FOR YOUR HELP . . .
     
    locals, Jun 23, 2009 IP
  2. geekology

    geekology Well-Known Member

    Messages:
    545
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    110
    #2
    That should be simple, you need to have is_category('<id>') and put this inside if else
     
    geekology, Jun 24, 2009 IP
  3. locals

    locals Well-Known Member

    Messages:
    1,677
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    153
    #3
    Thanks I will try adding that code in THANKS AGAIN !
     
    locals, Jun 24, 2009 IP