[Resolved] Youtube Video Block before navigation

Home Forums Support [Resolved] Youtube Video Block before navigation

Home Forums Support Youtube Video Block before navigation

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #2321592
    Guillermo

    Hi,
    I would like to add a youtube video block before navigation on the main page but for some reason it doesn’t work.
    What I’ve done is create a hook element (before header) with a container and a youtube block inside it with the url I want to.

    I’ve already tried the tutorial to use Page Hero backgroung , but I want to try this method and see how it looks.

    Website: https://arcillasoliete.com/

    Thanks.

    #2321606
    Ying
    Staff
    Customer Support

    Hi Guillermo,

    Solution 1:

    Use this PHP code. Adding PHP: https://docs.generatepress.com/article/adding-php/

    add_filter( 'generate_do_block_element_content', function( $content ) {
        global $wp_embed;
        $content = $wp_embed->autoembed( $content );
    	
        return $content;
    } );

    Solution 2:

    Go to this website, paste the video URL there, and copy the generated Embed code.
    https://embedresponsively.com/

    Then paste the embed code to an HTML block in the block element.

    #2322072
    Guillermo

    Yeah!, that works perfectly, many thanks.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.