1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Is there a plugin or way to ....

Discussion in 'Blogging' started by jack61, Mar 27, 2010.

  1. jack61

    jack61 Newbie

    Joined:
    Nov 25, 2009
    Messages:
    4
    Likes Received:
    8
    Is there a plugin or way to tell WPress to post a certain banner or link only in a specified category in every post on a auto blog. I use wprobot.
    I search in all the ways I could think of in the forum but couldn't find anything.:rolleyes:
     
  2. Rushdie

    Rushdie BANNED BANNED

    Joined:
    Feb 2, 2009
    Messages:
    1,378
    Likes Received:
    1,720
    yes I know how to do it without a plugin.

    Code:
    <?php
    
    if (is_home())
    {
    echo "<a href='link'><img src='image'></a>";
    }	
    
    elseif (in_category('3'))
    {
    echo "<a href='link'><img src='image'></a>";
    }
    
    elseif (in_category('4'))
    {
    echo "<a href='link'><img src='image'></a>";
    }
    
    else
    {
    echo "<a href='link'><img src='image'></a>";
    }
    
    ?>

    easy as pie :p give me rep please :) PM if you need anything I'm a WP virtuozzo :)

    edit:

    you need to edit the theme code and put it for example in the header.php or something :p
     
    • Thanks Thanks x 1
  3. jack61

    jack61 Newbie

    Joined:
    Nov 25, 2009
    Messages:
    4
    Likes Received:
    8
    Thanks Rushdie
    If I understand correct the '3' and '4' is where the category name come in. I will try it a bit later on. Have a idea or 2 for plugins for WP will PM you.
    Thanks again.

    Work 100%, I add it in the "Single post" page and work nice.
     
    Last edited: Mar 27, 2010
  4. Rushdie

    Rushdie BANNED BANNED

    Joined:
    Feb 2, 2009
    Messages:
    1,378
    Likes Received:
    1,720
    actually it's different. when you go to your wp-admin and to category management and point your mouse to the category link, down in your browser you will see an address with the category ID. I'm not sure if you can use a normal category name, but anyway it's not object oriented so don't do it.

    cheers