Site logo

[Resolved] Write PHP inside custom page headers?

Home Forums Support [Resolved] Write PHP inside custom page headers?

Home Forums Support Write PHP inside custom page headers?

Viewing 3 posts - 16 through 18 (of 18 total)
  • Author
    Posts
  • #1237983
    Tom
    Lead Developer
    Lead Developer

    Just adding the shortcode into the Element doesn’t work?

    You could try this:

    add_filter( 'generate_page_hero_output', function( $output, $options ) {
        return sprintf(
            '<div class="%1$s">
                <div class="%2$s">
                    %3$s
                </div>
                <div>
    		%4$s
                </div>
            </div>',
            trim( $options['container_classes'] ),
            trim( $options['inner_container_classes'] ),
            $options['content'],
            do_shortcode( '[ searchform post_types="tutorial" ]' ) // Remove spacing inside brackets, the forum was executing the shortcoe
        );
    }, 10, 2 );
    #1239140
    George

    Ah ok, removing the spaces as you suggested worked!

    Thanks, Tom.

    #1239305
    Tom
    Lead Developer
    Lead Developer

    No problem 🙂

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