Author Topic: How to hide embedded code  (Read 3748 times)

iainfogg

  • Full Member
  • **
  • Posts: 19
How to hide embedded code
« on: August 26, 2009, 05:54:27 am »
Hi, I am using one of the Revolution themes, which shows excerpts from the most recent posts in each category on the home page. It does it using the following call:

<?php the_content_limit(80, ""); ?>

This pulls the first x characters from the post (in this case 80) and shows them directly on the screen.

The problem is that if the post content is short, it then starts to show the code that the audio player uses. I then end up with this on the home page:

Recorded at Whatever Church – Sunday Live AM 26th July 2009 pp_flashembed( 'powerpress_player_97', {src:...

Is there another call you know of that I could use so it will strip out the pp_flashembed stuff from the content and just show "Recorded at Whatever Church – Sunday Live AM 26th July 2009" instead?

I appreciate this is more a Wordpress issue, I just don't know it that well.

Thanks!

iainfogg

  • Full Member
  • **
  • Posts: 19
Re: How to hide embedded code
« Reply #1 on: August 26, 2009, 06:13:50 am »
I've tried looking in the RSS feed for the site to see if that has the embedded code in and it doesn't, if that helps at all?

iainfogg

  • Full Member
  • **
  • Posts: 19
Re: How to hide embedded code
« Reply #2 on: August 26, 2009, 06:34:20 am »
FYI, this is the site in question - depending upon where I am up to hacking about with the code, you may or may not see the issue I mentioned.

http://79.170.44.113/audaciouscitychurch.com/

iainfogg

  • Full Member
  • **
  • Posts: 19
Re: How to hide embedded code
« Reply #3 on: August 26, 2009, 07:22:52 am »
I know this is becoming a monologue, as I figure out bits more as I go - apologies!

I have found the function the_content_limit, which has this code in it:

    $content = get_the_content($more_link_text, $stripteaser, $more_file);
    $content = apply_filters('the_content', $content);
    $content = str_replace(']]>', ']]&gt;', $content);
    $content = strip_tags($content);

I have tried adding the following line at various points but it never strips out the pp_flashembed:

    $content = strip_shortcodes($content);

How can this function be amended so it removes the pp_flashembed code which does, somehow, get removed from the RSS feed?

iainfogg

  • Full Member
  • **
  • Posts: 19
Re: How to hide embedded code
« Reply #4 on: August 26, 2009, 11:50:32 am »
OK, so I hacked those 4 lines of code, and finally found commenting out the apply_filters line stops the plugin sticking in the <script> tags which were being removed by strip_tags - unfortunately, the code in between <script> and </script> was being left in, on the original bit of code.

I could really do with a way of removing the code in between the two script tags, but I am fairly inept with PHP - any ideas?

angelo

  • CIO, RawVoice
  • Administrator
  • Hero Member
  • *****
  • Posts: 4483
Re: How to hide embedded code
« Reply #5 on: August 26, 2009, 11:56:00 am »
Use the get_the_excerpt() function and make sure PowerPress settings, the add player to excerpts option is disabled.

iainfogg

  • Full Member
  • **
  • Posts: 19
Re: How to hide embedded code
« Reply #6 on: September 01, 2009, 05:49:07 am »
Thanks - that's just the job - working properly now!

Cheers