Archived topic
generate_page_header_video_loop filter
28 replies · Started by Ella on January 10, 2017
Hello,
How would I go about adding the filter generate_page_header_video_loop to make the page header video stop looping?
Thank you!
Hi Ella,
Check this page on how to use filters: https://docs.generatepress.com/article/using-filters/
So for using generate_page_header_video_loop, you would do:
add_filter( 'generate_page_header_video_loop', 'generate_page_header_video_noloop' );
function generate_page_header_video_noloop()
{
return false;
}
Let me know.
Hi Leo,
Is there a way to input this without creating a plugin or child theme? I've tried inputting this with snippets already.
Thanks for your help!
The easiest way is definitely using Code Snippets plugin as suggested here: https://docs.generatepress.com/article/adding-php/
Sorry didn't see you already try Code Snippets. It didn't work?
Unfortunately no, it did not work.
I have adjusted the code above slightly. Can you give it another shot?
Nope, didn't work. Hmm... maybe I'll just create a child theme without the "video_options loop" line in the page header php file.
Thanks anyway! I really appreciate it :)
I'll ask Tom to have a look :)
You could try this..
add_action( 'after_setup_theme','tu_background_video_loop' );
function tu_background_video_loop()
{
add_filter( 'generate_page_header_video_loop', '__return_false' );
}
Make sure the code snippet is activated as well.
Hello!
Please help =)
I dont anderstand how to stop in the premium page header looping video?
Did you try the code I provided here? https://generatepress.com/forums/topic/generate_page_header_video_loop-filter/#post-262654
Adding PHP: https://docs.generatepress.com/article/adding-php/
Buenas tardes
Tengo el mismo problema, he probado los siguientes codigos sin conseguir eliminar el loop
-----
add_filter( 'generate_page_header_video_loop','__return_false' );
------
add_filter( 'generate_page_header_video_loop', 'generate_page_header_video_noloop' );
function generate_page_header_video_noloop()
{
return false;
}
------
add_action( 'after_setup_theme','tu_background_video_loop' );
function tu_background_video_loop()
{
add_filter( 'generate_page_header_video_loop', '__return_false' );
}
-----
Un saludo Gines
What version of GP Premium are you using?
Buenas tardes Tom
esto si es rapidez y excelente atencion
Estoy usando GP Versión: 1.3.46
y GP Premium 1.2.96
El video lo he insertado en Page header / BacKground video y siempre se ejecuta el loop y ha desaparecido el sonido.