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

angelo

  • CIO, RawVoice
  • Administrator
  • Hero Member
  • *****
  • Posts: 4483
Re: Problem: PowerPress adding a podcast where it doesn't belong...
« Reply #15 on: December 02, 2010, 05:12:39 pm »
If you are comfortable editing the PHP in your theme's home.php, I would do this:

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 strip_shortcodes($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 strip_shortcodes($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 strip_shortcodes($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 -->

I am guessing that the theme developer used the filter to get rid of the short codes from the content. The strip_shortcodes() function takes care of that.

richschmidt

  • Full Member
  • **
  • Posts: 14
Re: Problem: PowerPress adding a podcast where it doesn't belong...
« Reply #16 on: December 02, 2010, 05:49:13 pm »
I decided to do one more quick little test in light of your last comment, angelo.  [Edited: Sorry, I meant reply #13. I didn't see your last comment when I posted this one.]  The website in question relies almost entirely on pages and only rarely uses posts.  Lately, we've only been using posts as a way to add podcasts. So I tried creating a new post with no podcast or media file attached.  Then I changed the PowerPress "Media Presentation" switch from "None" back to "Below post."  Huh.  No more player on the main page (home.php).

Given this theme's peculiarities, if the most recent post has a podcast attached, then PowerPress adds that podcast & player to the 3 boxes on the main page.  If the most recent post doesn't have one attached, then the player doesn't appear.
« Last Edit: December 03, 2010, 08:37:00 am by richschmidt »

richschmidt

  • Full Member
  • **
  • Posts: 14
Re: Problem: PowerPress adding a podcast where it doesn't belong...
« Reply #17 on: December 03, 2010, 08:35:23 am »
If you are comfortable editing the PHP in your theme's home.php, I would do this:

<... code ...>

I am guessing that the theme developer used the filter to get rid of the short codes from the content. The strip_shortcodes() function takes care of that.

I'm comfortable editing the php.  That doesn't mean I always know what I'm doing, but I'm comfortable hacking away at it.  :) 

I haven't tried the strip_shortcodes() approach yet, but I tried it just using the content, without the apply_filters(), and I lost paragraph breaks and links.  I imagine I also would have lost formatting like lists, bold, etc., if I'd been using those at the time. I don't know if I would have lost images...

So for now, I'm just going to have the guy adding podcasts add the [powerpress] shortcode to the bottom of those posts as he adds them.  That, plus leaving the display setting on "None," fixes the problem with the players appearing on the home page.  It's not the ideal solution, but it works.  :)
« Last Edit: December 03, 2010, 08:38:02 am by richschmidt »

angelo

  • CIO, RawVoice
  • Administrator
  • Hero Member
  • *****
  • Posts: 4483
Re: Problem: PowerPress adding a podcast where it doesn't belong...
« Reply #18 on: December 03, 2010, 10:00:12 am »
Oh yes, you also need wptexturize() function call in there. So something like the following should work:

Code: [Select]
<?php echo strip_shortcodeswptexturize($box1->post_content) ); ?>