Author Topic: Problem: PowerPress adding a podcast where it doesn't belong...  (Read 5653 times)

richschmidt

  • Full Member
  • **
  • Posts: 14
Problem: PowerPress adding a podcast where it doesn't belong...
« on: December 01, 2010, 11:24:48 am »
For some reason, PowerPress is adding our most recent (and only) podcast in three places on our site's main page... when it shouldn't be putting them there at all.

You can see it at http://LivingHope.info.  (For now, I'll be disabling the plugin soon to keep this mess off our main page!)

We're using the Boldy theme from site5.com which has a custom home screen.  It grabs three pages and puts them on the home page below the javascript image slider.  For some reason, PowerPress is adding it's stuff to each of them.

Here's the relevant part of home.php from the theme:

Code: [Select]
<!-- begin home boxes -->
<?php $box1=get_post(get_option(&#39;boldy_home_box1&#39;));
  $box2=get_post(get_option(&#39;boldy_home_box2&#39;));
  $box3=get_post(get_option(&#39;boldy_home_box3&#39;)); 
  if(get_option(&#39;boldy_home_box1&#39;)!= null && get_option(&#39;boldy_home_box2&#39;)!= null && get_option(&#39;boldy_home_box3&#39;)!= null){?>

<div id="homeBoxes" class="clearfix">
<div class="homeBox">
<h2><?php echo $box1->post_title?></h2>
<?php echo apply_filters(&#39;the_content&#39;, $box1->post_content);?>
<!-- <a href="<?php echo get_option(&#39;boldy_home_box1_link&#39;)?>"><strong>Read more &raquo;</strong></a> -->
</div>
<div class="homeBox">
<h2><?php echo $box2->post_title?></h2>
<?php echo apply_filters(&#39;the_content&#39;, $box2->post_content);?>
<!-- <a href="<?php echo get_option(&#39;boldy_home_box2_link&#39;)?>"><strong>Read more &raquo;</strong></a> -->
</div>
<div class="homeBox last">
<h2><?php echo $box3->post_title?></h2>
<?php echo apply_filters(&#39;the_content&#39;, $box3->post_content);?>
<!-- <a href="<?php echo get_option(&#39;boldy_home_box3_link&#39;)?>"><strong>Read more &raquo;</strong></a> -->
</div>
</div>
<?php }?>
<!-- end home boxes -->


The only change I made was to comment out the "Read more" links.

Any ideas?

richschmidt

  • Full Member
  • **
  • Posts: 14
Re: Problem: PowerPress adding a podcast where it doesn't belong...
« Reply #1 on: December 01, 2010, 11:30:49 am »
Here's what the site looks like with PowerPress enabled.  I'm going to disable the plugin to get the mess off our main page.

http://twitpic.com/3bxt0u

richschmidt

  • Full Member
  • **
  • Posts: 14
Re: Problem: PowerPress adding a podcast where it doesn't belong...
« Reply #2 on: December 01, 2010, 11:48:45 am »
Also, I already have checked "Do Not Enhance Feeds" in the PowerPress Feeds settings.  We're doing category casting, only adding podcasts to posts in one particular category.  That works fine, and it's not adding players/podcasts to other posts on the site.  Just those being called on the main page.  Which, obviously, is a problem, since they aren't podcast posts.
« Last Edit: December 01, 2010, 03:47:38 pm by richschmidt »

angelo

  • CIO, RawVoice
  • Administrator
  • Hero Member
  • *****
  • Posts: 4483
Re: Problem: PowerPress adding a podcast where it doesn't belong...
« Reply #3 on: December 01, 2010, 01:21:21 pm »
Sounds like you figured it out, fixed your own problem?  :)

richschmidt

  • Full Member
  • **
  • Posts: 14
Re: Problem: PowerPress adding a podcast where it doesn't belong...
« Reply #4 on: December 01, 2010, 03:00:55 pm »
Um... no.  I haven't figured it out.  Unless you consider disabling the PowerPress plugin "figuring it out."   ???

(I just edited my previous post for clarity's sake. I most certainly have NOT figured it out yet!)
« Last Edit: December 01, 2010, 03:48:28 pm by richschmidt »

angelo

  • CIO, RawVoice
  • Administrator
  • Hero Member
  • *****
  • Posts: 4483
Re: Problem: PowerPress adding a podcast where it doesn't belong...
« Reply #5 on: December 01, 2010, 04:17:35 pm »
PowerPress adds the player anytime the filter 'the_content' is used, that way we can add the player to blog posts/pages. look at the lines with "apply_filters('the_content'..." in your code.

Due to the design of the theme, you have only one option, and that's to remove the player PowerPress adds to your pages. Go to PowerPress settings to the Appearance tab and for the first option labeled "Media Presentation", select "none". This will no longer place any PowerPress player in your posts at all.

A better designed theme would have either used the_excerpt / get_the_excerpt filters, or would have used the content directly from the blog post and not called the filters. Calling the filters is the theme's way of asking for plugins to add their content to the post/page content. Hope this makes sense.

richschmidt

  • Full Member
  • **
  • Posts: 14
Re: Problem: PowerPress adding a podcast where it doesn't belong...
« Reply #6 on: December 01, 2010, 08:38:10 pm »
I thought PowerPress performed some kind of check to only add the player to (1) posts with media files attached and/or (2) posts in the category I set up in the category casting section....? 

If it just indiscriminately adds the player to any and every post called with the filter 'the_content'... well, that seems like a bug, doesn't it?  Won't that cause problems with lots of different custom/premium themes that grab content and use it in unusual ways?

Edited to add:
According to the WP Codex, apply_filters('the_content', $content) is supposed to give the same output as using the_content().  Google found it for me on this page: http://codex.wordpress.org/Function_Reference/the_content

That must not be the case, though, because every post on the blog uses the_content(), but PowerPress doesn't add a player to every post.  Only posts with media attached that are in the right category... right?

I'm not a WP pro, so forgive me if I'm missing something basic here.
« Last Edit: December 01, 2010, 08:43:33 pm by richschmidt »

angelo

  • CIO, RawVoice
  • Administrator
  • Hero Member
  • *****
  • Posts: 4483
Re: Problem: PowerPress adding a podcast where it doesn't belong...
« Reply #7 on: December 02, 2010, 09:43:29 am »
You are adding the word 'category', please take that out of the equation. You can use an endless array of categories, that will not effect if PowerPress adds a player or not.

PowerPress adds a player to every post that has 'media'. More specifically, if WordPress (before PowerPress was enabled) saw you put a link to a media file anywhere in a blog post, WordPress would have made that into a podcast episode for you. Now that you have PowerPress enabled, PowerPress will not automatically make links to a media file in your post into a podcast unless you specifically say so by entering it into your Podcast Episode box.

Now that you are using PowerPress, you may just need to go in and edit the posts that you never intended to be podcasts and remove the media in the Podcast Episode box PowerPress adds. Again, PowerPress didn't make these into episodes, it's the fact that you were using WordPress without PowerPress, which means WordPress out of the box just assumes any media file in a post content is supposed to be a podcast episode. Very annoying bug, but no one over at WordPress.org wants to fix the issue.

richschmidt

  • Full Member
  • **
  • Posts: 14
Re: Problem: PowerPress adding a podcast where it doesn't belong...
« Reply #8 on: December 02, 2010, 09:51:53 am »
You are adding the word 'category', please take that out of the equation. You can use an endless array of categories, that will not effect if PowerPress adds a player or not.

PowerPress adds a player to every post that has 'media'. More specifically, if WordPress (before PowerPress was enabled) saw you put a link to a media file anywhere in a blog post, WordPress would have made that into a podcast episode for you. Now that you have PowerPress enabled, PowerPress will not automatically make links to a media file in your post into a podcast unless you specifically say so by entering it into your Podcast Episode box.

Now that you are using PowerPress, you may just need to go in and edit the posts that you never intended to be podcasts and remove the media in the Podcast Episode box PowerPress adds. Again, PowerPress didn't make these into episodes, it's the fact that you were using WordPress without PowerPress, which means WordPress out of the box just assumes any media file in a post content is supposed to be a podcast episode. Very annoying bug, but no one over at WordPress.org wants to fix the issue.

Angelo,

1. These are technically pages having their content grabbed by the theme and placed on the main page, not posts.  But that doesn't matter.  Everything in WP is basically a post. I get that.

2. More importantly, there's no media associated with these pages.  None.  Not before PowerPress, not after.  One of the pages was created after I installed and activated PowerPress.  I didn't add media to it.  But PowerPress adds a player.  And if I go back now to edit those pages, there's no media listed in the "Podcast Episode" box. 

So... the "very annoying bug" I'm experiencing doesn't appear to be the fault of WordPress.

richschmidt

  • Full Member
  • **
  • Posts: 14
Re: Problem: PowerPress adding a podcast where it doesn't belong...
« Reply #9 on: December 02, 2010, 09:58:44 am »
Due to the design of the theme, you have only one option, and that's to remove the player PowerPress adds to your pages. Go to PowerPress settings to the Appearance tab and for the first option labeled "Media Presentation", select "none". This will no longer place any PowerPress player in your posts at all.

This is the only thing I've found that seems to work... and it means having to add the [powerpress] shortcode to every podcast post we create.  Which is a pain, but at least it lets us continue to use PowerPress without it doing the goofiness to our main page I described above!

If anyone has an idea how I can either (1) modify PowerPress to fix the bug or (2) modify the theme to eliminate it, please let me know. 

(Switching from 'the_content' to 'the_excerpt' for the filter isn't really an option, as it would severely limit what we can put in those 3 boxes on our main page. And I don't know any other way to grab the content from those pages than the approach taken in the theme code shared above. It's very slick the way the Boldy theme works. It's just a shame PowerPress is choking on it.)

richschmidt

  • Full Member
  • **
  • Posts: 14
Re: Problem: PowerPress adding a podcast where it doesn't belong...
« Reply #10 on: December 02, 2010, 10:07:14 am »
Also, I already have checked "Do Not Enhance Feeds" in the PowerPress Feeds settings.  We're doing category casting, only adding podcasts to posts in one particular category.  That works fine, and it's not adding players/podcasts to other posts on the site.  Just those being called on the main page.  Which, obviously, is a problem, since they aren't podcast posts.

I just thought I would highlight this part of my earlier comment.  These three pages don't have any media associated with them, but PowerPress is adding a player to each of them.  Edited to add: It only adds the player to the content grabbed and placed on the custom home page.  It doesn't add the players to the pages if they are viewed "normally" as pages in WordPress.

I just did another test... and it turns out that the media that gets played by those 3 players on the home page is the most recent podcast.  Previously, we only had one post with a podcast on it, so I wasn't sure. So I added another one... and the players play the most recent one.

Again, I've now switched the player to "none" in the settings and have added the shortcode to the podcast posts, so you won't see the homepage problem if you go there now.  See the screenshot in my earlier comment if you want to see what it was doing.  BTW, not that it matters, but the podcast posts are here: http://www.livinghope.info/category/podcasts/sunday-messages/

Just some added details for anyone trying to track down the source of the bug.  Thanks!
« Last Edit: December 02, 2010, 10:59:03 am by richschmidt »

angelo

  • CIO, RawVoice
  • Administrator
  • Hero Member
  • *****
  • Posts: 4483
Re: Problem: PowerPress adding a podcast where it doesn't belong...
« Reply #11 on: December 02, 2010, 11:36:45 am »
When PowerPress adds a player to your home page, what is the media file it is playing? That may be a clue to the problem. If the post/page doesn't have a media file, perhaps the theme is incorrectly looping through page data while WordPress is looping through posts.

richschmidt

  • Full Member
  • **
  • Posts: 14
Re: Problem: PowerPress adding a podcast where it doesn't belong...
« Reply #12 on: December 02, 2010, 12:55:45 pm »
When PowerPress adds a player to your home page, what is the media file it is playing? That may be a clue to the problem. If the post/page doesn't have a media file, perhaps the theme is incorrectly looping through page data while WordPress is looping through posts.

I just did another test... and it turns out that the media that gets played by those 3 players on the home page is the most recent podcast.  Previously, we only had one post with a podcast on it, so I wasn't sure. So I added another one... and the players play the most recent one.

Here's the entirety of the home.php file from the Boldy theme, if you want to check it:
Code: [Select]
<?php get_header(); ?>
<!-- BEGIN SLIDER -->
  <div id="slider">
  <?php if(get_option(&#39;boldy_slider&#39;)!=&#39;&#39;){
$page_data get_page(get_option(&#39;boldy_slider&#39;));
$content $page_data->post_content;
echo $page_data->post_content;
}else{?>

<div style="border:1px solid #ddd; text-align:center; padding:150px 100px 0; height:219px; font-size:14px;">
This is the slider. In order to have items here you need to create a page in which to insert the images, simply one after another, setting up the link to point at ( if needed ) and text captions in the Title field. Then select the page as the "slider page" in the Theme Options Page. Make sure your images are 960px x 370px.
</div>
<?php }?>
</div>
   <div style="width:960px; margin:0 auto; background:url(<?php bloginfo(&#39;template_directory&#39;); ?>/images/bk_shadow_slider.png) 0 0 no-repeat; height:50px;"></div>
   <!-- END SLIDER -->
   <!-- BEGIN BLURB -->
   <?php if(get_option(&#39;boldy_blurb_enable&#39;)=="yes" && get_option(&#39;boldy_blurb_text&#39;)!=""){ ?>
   <div id="blurb">
<p>
<a href="<?php 
if(get_option(&#39;boldy_blurb_page&#39;)!=""){
echo get_permalink(get_option(&#39;boldy_blurb_page&#39;));
}elseif(get_option(&#39;boldy_blurb_link&#39;)!=""){
echo get_option(&#39;boldy_blurb_link&#39;);
?>
"><img src="<?php bloginfo(&#39;template_directory&#39;); ?>/images/but_blurb.png" alt="" /></a>
<?php echo get_option(&#39;boldy_blurb_text&#39;); ?>
</p>
   </div>
   <?php }?>
   <!-- END BLURB -->
   <!-- BEGIN HOME CONTENT -->
   <!-- begin home boxes -->
<?php $box1=get_post(get_option(&#39;boldy_home_box1&#39;));
  $box2=get_post(get_option(&#39;boldy_home_box2&#39;));
  $box3=get_post(get_option(&#39;boldy_home_box3&#39;)); 
  if(get_option(&#39;boldy_home_box1&#39;)!= null && get_option(&#39;boldy_home_box2&#39;)!= null && get_option(&#39;boldy_home_box3&#39;)!= null){?>

<div id="homeBoxes" class="clearfix">
<div class="homeBox">
<h2><?php echo $box1->post_title?></h2>
<?php echo apply_filters(&#39;the_content&#39;, $box1->post_content);?>
<!-- <a href="<?php echo get_option(&#39;boldy_home_box1_link&#39;)?>"><strong>Read more &raquo;</strong></a> -->
</div>
<div class="homeBox">
<h2><?php echo $box2->post_title?></h2>
<?php echo apply_filters(&#39;the_content&#39;, $box2->post_content);?>
<!-- <a href="<?php echo get_option(&#39;boldy_home_box2_link&#39;)?>"><strong>Read more &raquo;</strong></a> -->
</div>
<div class="homeBox last">
<h2><?php echo $box3->post_title?></h2>
<?php echo apply_filters(&#39;the_content&#39;, $box3->post_content);?>
<!-- <a href="<?php echo get_option(&#39;boldy_home_box3_link&#39;)?>"><strong>Read more &raquo;</strong></a> -->
</div>
</div>
<?php }?>
<!-- end home boxes -->
   <!-- END HOME CONTENT -->
   
   <!-- SLIDER SETTINGS -->
   <script type="text/javascript">
$(window).load(function() {
$('#slider').nivoSlider({
effect:'random', //Specify sets like: 'fold,fade,sliceDown'
slices:15,
animSpeed:500,
pauseTime:7000,
startSlide:0, //Set starting Slide (0 index)
directionNav:true, //Next & Prev
directionNavHide:true, //Only show on hover
controlNav:true, //1,2,3...
controlNavThumbs:false, //Use thumbnails for Control Nav
controlNavThumbsFromRel:false, //Use image rel for thumbs
controlNavThumbsSearch: '.jpg', //Replace this with...
controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
keyboardNav:true, //Use left & right arrows
pauseOnHover:true, //Stop animation while hovering
manualAdvance:false, //Force manual transitions
captionOpacity:0.7, //Universal caption opacity
beforeChange: function(){},
afterChange: function(){},
slideshowEnd: function(){} //Triggers after all slides have been shown
});
});
</script>

<?php get_footer(); ?>

It doesn't even do the WP loop.  And I just check header.php and footer.php... and the loop isn't hiding in there, either.  So WP isn't looping through anything on the page in question.

The theme is basically using those 3 pages as a variation on a widgetized area.

angelo

  • CIO, RawVoice
  • Administrator
  • Hero Member
  • *****
  • Posts: 4483
Re: Problem: PowerPress adding a podcast where it doesn't belong...
« Reply #13 on: December 02, 2010, 02:31:11 pm »
You need a professional WordPress theme developer to fix the problem with the theme. The theme should be looping through something, it's a fundamental feature of WordPress (read more here). If the theme doesn't do any looping with functions such as have_posts() and the_post() inside of a loop, then WordPress itself will assume that the home page load should load the latest 10 blog posts with the most recent post being the first one in the loop. At that point, calling the filters without modifying the loop in anyway, the plugins will assume that the latest post that WordPress loaded is the content it is modifying. More correctly,your theme should be calling the_content(), rather than calling apply_filters('the_content', $content) with it's own $content.

To explain in logic, when you call the_content filter, PowerPress (and other plugins for that matter) will call loop functions such as get_the_excerpt() or get_the_ID(), which do not correspond with the actual content your theme is loading from some $box1-3. Technically speaking, if the box1-3 data isn't even from a blog post or static page, it shouldn't even be using the_content filter.

A shot in the dark that may fix your problem, though it's still not correct, is to go into WordPress "Settings" > "Reading" page and for the first option labeled "Front page displays", select "A static page", then with the 2 sub options, make sure for the "Front page" you select a static page that does not have a podcast episode in it. You will also need to create another static page with no content in it that you can then select as your posts page with the "Posts page" option. Again, this is a 'hack' to fix a poorly written theme home page, and I'm not exactly sure it will work but it should in theory.

richschmidt

  • Full Member
  • **
  • Posts: 14
Re: Problem: PowerPress adding a podcast where it doesn't belong...
« Reply #14 on: December 02, 2010, 03:39:19 pm »
Thanks, angelo.  I'm not sure why the developers of this theme went with the approach they did.  For some reason, their custom home page replaces the default "most recent posts" instead of operating as a special "static page."  Maybe I'll do a little digging into the theme and see if I can fix it.  As it stands, if I select a static page for my main page, I lose all the special theme options (javascript slider, etc) because it's no longer using home.php.

I've used several different themes over the past 5 years or so, and this is the first time I've encountered one that took this approach.

Thanks for your patience and for your help!