Author Topic: Player injected onto custom Blog Listing page that applies the_content filter  (Read 1257 times)

Victoria Foundation

  • Rookie
  • *
  • Posts: 4
Hello,

Firstly thanks for the service and plugin it's made our implementation a breeze.

What I ran into today;
Page - https://victoriafoundation.bc.ca/whats-new/
Screen - https://i.imgur.com/LNT0jCQ.jpg

As you can see from the screenshot, when the Podcast was the most recent post it's player was injected twice on the blog listing (is_home) as we have two apply_filters using the_content filter on the custom intro and header for that page.

To avoid this conflict I updated powerpress.php within the powerpress_content function so if it was is_home then it wouldn't do anything and would just return the untouched $content.

This has fixed my issue for now but would like ti implemented in the next release so updating doesn't just lose my change.

My Change was on line 110;
   if( is_feed() || is_home() )
      return $content; // We don't want to do anything to the feed or blog listing

Thank you for looking into this.

Shawn Thorpe

  • Administrator
  • Hero Member
  • *****
  • Posts: 2006
I have forwarded your request to the PowerPress dev team.

angelo

  • CIO, RawVoice
  • Administrator
  • Hero Member
  • *****
  • Posts: 4483
Hello Victoria,

Thanks for the code change. The big problem though is adding is_home() will remove the player from all homepages for everyone using PowerPress.

We do have a feature on the TODO list that would allow each user to pick if the player appears on the various is_home, is_archive, is_tag, etc... type pages, but it has not been developed. I will mark a note in the comments for this task linking to this forum thread, I think this is optimal feature that you would want ultimately.

Thanks,
Angelo

Victoria Foundation

  • Rookie
  • *
  • Posts: 4
Thank you Angelo, that's great news. Appreciate you linking my topic there so I'll get a heads up when this is implemented. I appreciate you help.
Cheers

Victoria Foundation

  • Rookie
  • *
  • Posts: 4
Hi Angelo, is there any update on this issue? Thank you

Shawn Thorpe

  • Administrator
  • Hero Member
  • *****
  • Posts: 2006
This thread will be locked to further replies to keep communication lines from fracturing. The discussion continues here:
https://wordpress.org/support/topic/player-injected-onto-custom-blog-listing-page-that-applies-the_content-filter/