1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Wordpress Podcasting Problem

Discussion in 'PHP' started by tomupton, May 29, 2012.

  1. #1
    Hi Guy's,

    Really struggling here and could really do with some expert advice?

    This could be a quite long winded email, but im hoping someone can help here!

    OK here is my current website - http://housemusicpodcasts.co.uk/ each artist on the site has their own podcasts category! An example looks like this - http://housemusicpodcasts.co.uk/category/futuristic-polar-bears

    You can then go into the detail of one of the posts where you can then download the podcast etc. For example this page - http://housemusicpodcasts.co.uk/futuristic-polar-bears/11365

    You will see that ive added the player and itunes subscribe link.

    Anyway this site is really old and im in the process of re-vamping it! Here is the example of the new website and how the podcasts are being displayed - http://www.housepodcasts.com/futuri...polar-bears-global-radio-week-60-shane-kehoe/

    On this page ive added the "iTunes and Rss Subscribe links" This has been done by editing the functions page within the theme itself. This is the code ive added:

    // itunes
    function themename_powerpress_player_links($content, $media_url, $ExtraData = array())
    {
    $category = get_the_category();
    $content .= ' '.POWERPRESS_LINK_SEPARATOR .' ';
    $content .= 'Subscribe Via iTunes: <a href="#">iTunes e.g. itpc:// Link </a> <br>';
    $content .= ' '.POWERPRESS_LINK_SEPARATOR .' ';
    $content .= 'Subscribe To Feed: <a href="#">Standard RSS Feed Link</a><br>';
    return $content;
    }
    add_filter('powerpress_player_links', 'themename_powerpress_player_links', 100, 3);

    What i need this to do is display the 2 rss feeds, one for itunes and one for the standard rss. What i mean by itunes is the "itpc://" link.

    On this new site ive setup category podcasting under the powerpress settings, i dont know if this is the correct method or not.

    Please can someone give me some help on this?

    To give you an idea, this was the old coding that was originally added to the old website which seemed to work fine. This code was added to standard post page, but was a bit of a pain as with posts that did not have a podcast the links would still appear.

    The codeing that was used to create this is the following:

    <?php
    foreach((get_the_category()) as $category) {
    $catid = $category->cat_ID ;
    }
    $url = get_category_link($catid) . "/feed";
    $url = str_replace("http", "itpc", $url);
    ?>
    <?php
    foreach((get_the_category()) as $category) {
    $catid = $category->cat_ID ;
    }
    $url2 = get_category_link($catid) . "/feed";
    ?>

    Then this is the code that generates the links on the page itself:

    <img src="<?php bloginfo('template_directory'); ?>/images/46.png" align="absmiddle"/> -
    <a href="<?php echo $url;?>" target="_blank">Subscribe via itunes </a><br />
    <img src="<?php bloginfo('template_directory'); ?>/images/25.png" align="absmiddle"/> -
    <a href="<?php echo $url2;?>" target="_blank">Podcast this show</a><br />

    Is there anyway you could code this into the current functions page?


    Regards

    Tom
     
    tomupton, May 29, 2012 IP