WordPress.org

Ready to get started?Download WordPress

Forums

Custom placement of podcast enclosure (33 posts)

  1. peteraltenberg
    Member
    Posted 5 years ago #

    I'm now using the Podcasting plugin and it seems to work OK but I would like to know how to place the podcast enclosure/player where I want it. Right now I have the more.... thing activated and I would like to have the player right after more. Is there a way to do that by putting some tag directly in the post, without the player showing up in the middle of the post on the main post page, or better yet some tag I can put on my index page to place it exactly where I want in some div?

    Thanks.

  2. cavemonkey50
    Member
    Posted 5 years ago #

    Peter, the Podcasting player is very flexible in placement. When you press the "Send to Editor" button, it outputs some code like [podcast]URL[/podcast]. Just move that code to where you want the player to display. That's all you need to do.

  3. peteraltenberg
    Member
    Posted 5 years ago #

    Thanks for the reply, but the problem is I'm using <!--more--> in my post. If I put that [podcast]URL[/podcast] before the <!--more--> it works, but then the player is position sort of strangely before the <!--more-->, and when I go to the single page for the post the player is plopped in the middle of the post text. If it's after the <!--more--> it doesn't show up at all until I go to the single post page. I tried putting the [podcast]URL[/podcast] in the Excerpt field and then placing that field in my index file but that didn't work.

    Maybe there's another way to place it somewhere, some HTML thing in the post? Or maybe there's a different way to do the "more" thing? I suppose I could have the content with my own more link to the single page and then on the single page put the full text from Excerpt. I can try that but even if it works it seems a bit clumsy.

    What I'd really like is to have complete control of where it's placed by separately calling it from my index page, if that makes sense.

    Thanks.

  4. peteraltenberg
    Member
    Posted 5 years ago #

    OK, I tried using have the partial post with the [podcast]URL[/podcast] on my index page and then have the full post on my single page using the Excerpt but the problem is then I cannot have the player on the single page. [podcast]URL[/podcast] doesn't work in the excerpt. I guess it WP doesn't process the excerpt the same way as the content. Would be nice if that worked and I could place the Excerpt (or maybe Custom field) where ever I want on my index template page. Any ideas?

  5. cavemonkey50
    Member
    Posted 5 years ago #

    Are you familiar with some basic PHP coding? If so, I could write a small snippet that you could adapt for automatic placement in your theme.

  6. Saberj
    Member
    Posted 5 years ago #

    I've been trying to use this to place it in my Podcast post excerpt. But it doesn't appear to work there either...

    I'd be interested in the PHP code to do something like that. But it'd be great if it could be used in the excerpt out of the box, if that's possible.

  7. peteraltenberg
    Member
    Posted 5 years ago #

    If you could send me a snippet of code for my theme that would be great. I'm familiar enough with PHP coding to figure out how to use some code.

    Thanks!

  8. cavemonkey50
    Member
    Posted 5 years ago #

    Here you go guys, this snipped of code will loop through all the podcasts on a given post, and display the player. You can add some if statements to change when it displays, or customize the output within the loop.

    <?php
    
    while ( $podcast = get_post_meta($post->ID, 'enclosure', false) )
    {
         $podcast = explode("\n", $podcast);
         $podcast_details = unserialize($podcast[3]);
    
         // echo $podcast[0]; // The URL for the enclosure.
         // print_r($podcast_details); // The iTunes details for the podcast.
    
         echo podcasting_shortcode(array('type'=>'mp3'), $podcast[0]); / Output the player. Change mp3 to video for video player (beta only).
    }
    
    ?>
  9. peteraltenberg
    Member
    Posted 5 years ago #

    Thanks for the code. When I put this code in on my theme page it makes the page go into an infinite loop displaying audio players over and over on the page and I have to kill the browser. I only have one podcast per post, can you tell me how to make it work for just one podcast, then it won't loop I would think. Or am I doing something wrong. I assume I don't need to put the [podcast]URL[/podcast] code in the post itself, right?

    Thanks very much for your help.

  10. cavemonkey50
    Member
    Posted 5 years ago #

    Well, if you're only anticipating one podcast per post, try this:

    $podcast = get_post_meta($post->ID, 'enclosure', false);
    
    $podcast = explode("\n", $podcast);
    $podcast_details = unserialize($podcast[3]);
    
    // echo $podcast[0]; // The URL for the enclosure.
    // print_r($podcast_details); // The iTunes details for the podcast.
    
    echo podcasting_shortcode(array('type'=>'mp3'), $podcast[0]); // Output the player. Change mp3 to video for video player (beta only).
  11. peteraltenberg
    Member
    Posted 5 years ago #

    Brilliant, thanks very much. I actually just figured that out, to take the 'while' loop out. I'm very slowly getting the hang of php.

    Thanks again.

  12. peteraltenberg
    Member
    Posted 5 years ago #

    OK, sorry but another glitch. The player is now showing up where I want it but it's not finding the sound file. I did a test and put the player back in the post (like normal with a 'send to editor') and the player finds the sound file, but when I have the player in the theme with the code you gave it doesn't find the sound file, says "error opening file".

  13. Saberj
    Member
    Posted 5 years ago #

    Thanks for the code, CM. I'm not quite as handy with PHP as I wish. But I'll probably figure it out at some point soon. I think it'd be handy if at some point in the future Podcasting's settings page had a "Include Player in Excerpt as Well" option tick box.

    I've been frustrated lately because there doesn't seem to be any Podcast theme developers for WordPress. Video Game review sites, Magazines, Image Blogging. But no Podcast specific themes. So this stuff helps me make a "Recent Podcasts" sidebar to view the most recent episodes of the show...

  14. peteraltenberg
    Member
    Posted 5 years ago #

    Sorry to bother again but I got the audio player where I want it but it isn't finding the audio file correctly. Any Ideas? Maybe it's easier to skip the Podcasting plugin and player and just link to an audio file?

    Also, I don't understand completely what the feed URL should be for iTunes, just the location of the audio files?

  15. cavemonkey50
    Member
    Posted 5 years ago #

    I apologize for all the errors. I haven't been at my main development machine all weekend and could not test my code. I just corrected the issue which was present in that code:

    <?php
    
    $podcast = get_post_meta($post->ID, 'enclosure', false);
    
    $podcast = explode("\n", $podcast[0]);
    $podcast_details = unserialize($podcast[3]);
    
    //echo $podcast[0]; // The URL for the enclosure.
    //print_r($podcast_details); // The iTunes details for the podcast.
    
    echo podcasting_shortcode(array('type'=>'mp3'), $podcast[0]); // Output the player. Change mp3 to video for video player (beta only).
    ?>

    Regarding the iTunes feed URL, I'm not sure what you're referencing. Where are you seeing this in Podcasting?

    Saberj, I'll look into figuring out why excepts aren't working and try to get a fix in the next version.

  16. peteraltenberg
    Member
    Posted 5 years ago #

    Thanks very much once again for the code. Now it's working fine. Well, it plays now but there's one small thing, none of the data shows up in the player when it's playing, like author and length. Isn't that supposed to show up? Here's what's showing up in a the enclosure:

    http://www.howpositiveareyou.com/feed/podcast/HindiAd.mp3
    727357
    audio/mpeg
    a:5:{s:6:"format";s:14:"default-format";s:8:"keywords";s:0:"";s:6:"author";s:0:"";s:6:"length";s:0:"";s:8:"explicit";s:0:"";}

    Sorry about the unclearness of the URL for the feed. I want to have two links in my template to the feed one going to the normal RSS2 and one that opens up in iTunes. Right now I have it set to itpc://www.howpositiveareyou.com/?feed=atom. Is that correct? In my Podcasting settings it says the "Podcast feed address (URL):
    http://www.howpositiveareyou.com/feed/podcast/". So what should the link be for RSS and itpc on my template page?

    Thanks again.

  17. peteraltenberg
    Member
    Posted 5 years ago #

    OK, I've been trying to make stab at getting the player to show the author info. I tried updated to the Podcasting version 2.0b5 but then the player wasn't showing up on my index page. Now I went back to the older version but I updated the flash player and now what I get is a working player but it will only show "Track #1" for the info. Any ideas how to change the Track info?

    Thanks.

  18. cavemonkey50
    Member
    Posted 5 years ago #

    Peter,

    That information on the player is being grabbed from the ID3 information in the MP3 file. You have to change the MP3 to alter the player track information.

    For the link, just do either

    itpc://www.howpositiveareyou.com/feed/podcast/

    or

    itpc://www.howpositiveareyou.com/?feed=podcast

  19. peteraltenberg
    Member
    Posted 5 years ago #

    Thanks again. Now the player is working great and I got the track info working as well with the ID3 information. One more thing if you could please help. The URLs for the RSS feed and the itpc feed do not work still. Why can't it find the podcasts in the specified directory? Is there something I need to add in the post?

  20. cavemonkey50
    Member
    Posted 5 years ago #

    Ah, you have to attach files to posts. Podcasting does not automatically scan directories for files. Just go into your post which relates to that episode, and paste the URL of the file in the Podcasting window found on the Write / Manage screen.

  21. peteraltenberg
    Member
    Posted 5 years ago #

    Hmmmm, I'm not sure I understand. I thought that's what I did already to get the player to play my podcast for a post. I entered the URL of the MP3 file in the Podcasting section of the Write / Manage screen and hit Add. Then my podcast shows up in the post with the player. Am I missing something? It seems like my URL is there already but it still doesn't find it.

  22. patrickcella
    Member
    Posted 5 years ago #

    Forgive for asking what may be a newbie question. I would like to edit the color, size and title of the enclosure/player on the blog entry. I could live with editing just the title. Is there a place to make these changes? Thanks!

    I love the plug-in by the way.

  23. cavemonkey50
    Member
    Posted 5 years ago #

    Hmm, I see. Yes, you are doing that correctly. It looks like you may have some feed validation errors. Go to the Podcasting options page and try replacing the & in this line with the word 'and':

    A weekly podcast of surprising news and views on HIV & AIDS

    If that works, I'll have a fix out which corrects the issue.

    --

    patrickcella, look in Podcasting's options page. If your on the 1.6x version there are explicit fields to change the colors. The 2.x beta version have a single field with instructions on how to make that and many other changes.

  24. peteraltenberg
    Member
    Posted 5 years ago #

    OK, removed the & but still not working. Any other ideas?

  25. cavemonkey50
    Member
    Posted 5 years ago #

    It appears to be working for me. I clicked the links I gave you earlier and both of them were added to my iTunes podcast list and the latest episode downloaded. Perhaps you're seeing a cached version?

  26. peteraltenberg
    Member
    Posted 5 years ago #

    OK, I think it must have been cached before. Now it's working. Great! Thanks so much for the help.

    I hate to keep going on but there's one more thing, I promise the last. I uploaded an image for the podcast art and put the URL in under the Podcast Art URL setting but it doesn't who up in iTunes.

  27. cavemonkey50
    Member
    Posted 5 years ago #

    The Podcast Art only shows up in your iTunes directory listing and may take up to 72 hours to display after adding the artwork. The album artwork window when playing a podcast relies on the artwork to be embedded in the actual MP3/AAC/etc file and does not look at the feed for that information.

  28. peteraltenberg
    Member
    Posted 5 years ago #

    OK, makes sense. Seems like all the ID3 info is suddenly not showing up. Just back to "track #1". Do I need to update something?

  29. cavemonkey50
    Member
    Posted 5 years ago #

    Did you change anything that made this occur?

  30. peteraltenberg
    Member
    Posted 5 years ago #

    No, didn't do anything to MP3's that were already uploaded. I made some changes in the Podcasting settings but now they are back to what they were before. I tried uploading some new test MP3s with the ID3 info but still it always says "Track #1" for the info.

Topic Closed

This topic has been closed to new replies.

About this Topic