Author Topic: "Don't display player" still displays in excerpts  (Read 2668 times)

DanielJLewis

  • Full Member
  • **
  • Posts: 16
"Don't display player" still displays in excerpts
« on: May 28, 2013, 04:50:37 pm »
In a recent podcast episode, I attached media to both my default channel and the video channel. But I have set the default channel to not display the player (because it's just an audio announcement telling subscribers to check the video feed for this week).

I have PowerPress set to display the player in excerpts.

The problem is that the audio "Podcast: Play in new window | Download" still displays in the excerpt on my front page for the default channel, even though I've set it to not display the player.

Then again, this is the behavior I want inside the post where I don't want the player for the video channel to display (because I'm using the YouTube video), but I do want these "Podcast: Play in new window | Download" links to appear. But I'm forcing those links to appear in the post by inserting "[powerpress channel='video']" in my post.

So in one way, this is functioning like I want (displaying just the links for the video player in the excerpt, even though the video channel is set to not display the player). But on the other hand, it's not functioning like I want (it's not hiding the audio player that I don't want displayed anywhere on the site for this particular episode.

Maybe the only way to fix this would be add a "don't display this player in excerpt" option to each channel's "Podcast Episode" widget in the post editor.

angelo

  • CIO, RawVoice
  • Administrator
  • Hero Member
  • *****
  • Posts: 4483
Re: "Don't display player" still displays in excerpts
« Reply #1 on: June 03, 2013, 03:02:12 pm »
I've been investigating this, it is rather complicated but it is possible to add this option. I've added it to the feature TODO list.

angelo

  • CIO, RawVoice
  • Administrator
  • Hero Member
  • *****
  • Posts: 4483
Re: "Don't display player" still displays in excerpts
« Reply #2 on: June 05, 2013, 03:08:39 pm »
I am thinking this may be easier to specify in the shortcode. Something like [powerpress excerpts="no" ...]

DanielJLewis

  • Full Member
  • **
  • Posts: 16
Re: "Don't display player" still displays in excerpts
« Reply #3 on: June 06, 2013, 08:50:30 am »
YES! That would be a great way to implement it!

[powerpress excerpt="no" player="no"]

angelo

  • CIO, RawVoice
  • Administrator
  • Hero Member
  • *****
  • Posts: 4483
Re: "Don't display player" still displays in excerpts
« Reply #4 on: June 18, 2013, 02:18:37 pm »
What is the player="no" for?

angelo

  • CIO, RawVoice
  • Administrator
  • Hero Member
  • *****
  • Posts: 4483
Re: "Don't display player" still displays in excerpts
« Reply #5 on: June 18, 2013, 02:21:34 pm »
By the way, the excerpt="no" does not work, because WordPress does not allow shortcodes in excerpts.

I believe your theme is using the_content for your excerpts, which would explain the behavior your describing.

DanielJLewis

  • Full Member
  • **
  • Posts: 16
Re: "Don't display player" still displays in excerpts
« Reply #6 on: June 18, 2013, 04:03:18 pm »
I was assume this shortcode would be in the content. So player="no" would not display the player in the content.

But I think I also understand the excerpt problem, unless PowerPress can change its behavior based on the existence of a contained shortcode.

angelo

  • CIO, RawVoice
  • Administrator
  • Hero Member
  • *****
  • Posts: 4483
Re: "Don't display player" still displays in excerpts
« Reply #7 on: June 18, 2013, 04:54:21 pm »
Problem is, the WordPress filters for the_excerpt and get_the_excerpt first strip the shortcodes from the content, then call the filters. So PowerPress in this case either has to try to add the player and links or not.

I suspect your theme may be doing something to the content after it calls get_the_excerpt which may be stripping out object and embed information, but leaving normal HTML. That would explain why the links stay but the player is gone.