WordPress Passing Categories in posts

Discussion in 'PHP' started by tomupton, Jan 22, 2009.

  1. #1
    Hi all,

    Im hoping someone can help me here as its been driving me up the wall the last 2 days!

    Ok here is my example in which im hoping someone can point me in the right direction - http://lifted-radio.co.uk/podcasts/?p=26

    You will notice there is an RSS feed icon for this post. The idea is when someone clicks that icon Itunes will open so that specific person can subscribe to that specific Podcasts/RSS.

    The situation is, each artisit is going to have their own specific feed so people can subscribe to that specific person.

    Im having kittens here trying to sort this out so it works!

    Currently its displaying all feeds like this - itpc://lifted-radio.co.uk/podcasts/?cat=&feed=rss2 as you can see the CAT is blank.

    Here is where things get confusing. If you visit this page - http://lifted-radio.co.uk/podcasts/?cat=16 - The CAT is appearing. Im using the below code, can someone make a suggestion. If its going to be a complex job im happy to pay someone.

    Thanks in advance.

    
    <?php
    $url = get_category_link($cat) . "&feed=rss2";
    $url = str_replace("http", "itpc", $url); 
    ?>
    
    <div class="topPost">
      <h2 class="topTitle"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
      <p class="topMeta">by <?php the_author_posts_link(); ?> on <?php the_time('M.d, Y') ?>,<br/>Under: <?php the_category(', '); ?> <br /><br />
    </p[B]><a href="<?php echo $url;?>" target="_rss"> <img src="<?php bloginfo('template_directory'); ?>/images/rsstodj.gif"/>[/B]</a></p>
      <div class="topContent"><?php the_content('(continue reading...)'); ?></div>
      <span class="topTags"><?php the_tags('<em>:</em>', ', ', ''); ?></span>
    <div class="cleared"></div>
    
    
    PHP:
     
    tomupton, Jan 22, 2009 IP