How to display different blogroll depending on category in wordpress

Discussion in 'PHP' started by onebuck, Jun 4, 2010.

  1. #1
    Does anybody know how I can display a different "blogroll" (or different backlinks) based on category selected in wordpress?
     
    onebuck, Jun 4, 2010 IP
  2. roopajyothi

    roopajyothi Active Member

    Messages:
    1,302
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #2
    roopajyothi, Jun 4, 2010 IP
  3. umpahpah

    umpahpah Well-Known Member

    Messages:
    266
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    108
    #3
    and if you want to have manual control and write code, you can use wordpress template tags
    for specifying different content in different category, write in template file something like

    <?php if (in_category('first')) { ?>
    BLOGROLL DISPLAY CODE HERE
    <?php } else if (in_category('second')) { ?>
    ANOTHER BLOGROLL DISPLAY CODE HERE
    <?php } else { ?>
    DISPLAY OTHER BLOGROLL CODE HERE
    <?php } ?>

    "first" and "second" are slug names of categories
     
    umpahpah, Jun 5, 2010 IP
  4. onebuck

    onebuck Peon

    Messages:
    68
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thank you guys, that worked.
     
    onebuck, Jun 10, 2010 IP
  5. roopajyothi

    roopajyothi Active Member

    Messages:
    1,302
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #5
    I hope there is a Plug-in Available Now!
    Passed a blog post yesterday but forgot the name
     
    roopajyothi, Jun 12, 2010 IP