Archived topic
Video loop filter isn't stopping the loop?
9 replies · Started by Katie Jones on August 16, 2017
Hi hi,
I'm using this code in my functions.php to stop the video loop, in the latest GP, though the video is still looping. Any ideas?
add_filter( 'generate_page_header_video_loop','__return_false' );
Editing to add the link: http://carefreemedium.staging.wpengine.com/
Edit 2: It's easy to make a change to a live site and not the staging site on WP Engine - I checked that I made the update to the staging site, by replacing the code with die() - yep, it's the right site. :)
Hi Katie,
Can you give this method a shot? https://generatepress.com/forums/topic/generate_page_header_video_loop-filter/page/2/#post-297665
Let us know :)
Thanks Leo! Though shoot, this still isn't working. I've tried clearing cache. I temporarily stuck a die() in the tu_disable_video_loop function before the return and the page still loads so I wonder if that function isn't being hit. I don't have any hooks disabled in GP Hooks. Any ideas?
The code I have in my functions.php file is:
add_filter( 'generate_page_header_video_loop', 'tu_disable_video_loop' );
function tu_disable_video_loop() {
return 'loop:false';
}
It seems that filter was removed in 1.4.
It was a "broken" filter before, which is likely why. I'll improve it and re-add it into the next version (coming out today or tomorrow).
Oh cool, thanks Tom!
Couldn't get it out today, but I can send you the latest version just to make sure it's all fixed if you like? If that sounds good just shoot me an email: https://generatepress.com/contact/
I will, thank you! :)
I just sent you the upcoming version.
You should be able to do this now:
add_filter( 'generate_page_header_video_loop', '__return_false' );
That works!
For everyone's reference, this other code floating around did not work:
add_filter( 'generate_page_header_video_loop', 'tu_disable_video_loop' );
function tu_disable_video_loop() {
return 'loop:false';
}
Thanks, Tom! :)
You're welcome! :)