Error
Call to undefined function is_shop() Error thrown with message "Call to undefined function is_shop()" Stacktrace: #52 Error in /var/www/clients/client15/web36/web/wp-content/themes/valdargan/functions.php:160 #51 vda_header in /var/www/clients/client15/web36/web/wp-includes/shortcodes.php:343 #50 do_shortcode_tag in [internal]:0 #49 preg_replace_callback in /var/www/clients/client15/web36/web/wp-includes/shortcodes.php:218 #48 do_shortcode in /var/www/clients/client15/web36/web/wp-includes/class-wp-hook.php:289 #47 WP_Hook:apply_filters in /var/www/clients/client15/web36/web/wp-includes/plugin.php:206 #46 apply_filters in /var/www/clients/client15/web36/web/wp-includes/widgets/class-wp-widget-custom-html.php:147 #45 WP_Widget_Custom_HTML:widget in /var/www/clients/client15/web36/web/wp-includes/class-wp-widget.php:380 #44 WP_Widget:display_callback in /var/www/clients/client15/web36/web/wp-includes/widgets.php:805 #43 dynamic_sidebar in /var/www/clients/client15/web36/web/wp-content/plugins/gantry5/src/classes/Gantry/WordPress/Widgets.php:90 #42 Gantry\WordPress\Widgets:displayPosition in /var/www/clients/client15/web36/web/wp-content/plugins/gantry5/src/classes/Gantry/Framework/Platform.php:248 #41 Gantry\Framework\Platform:displayWidgets in /var/www/clients/client15/web36/web/wp-content/plugins/gantry5/src/vendor/twig/twig/src/Template.php:704 #40 Twig\Template:getAttribute in /var/www/clients/client15/web36/web/wp-content/cache/gantry5/valdargan/twig/73/73b4f5cf380b0592084fada21a01ec5306c3a2ed3698c9b7cf096323e3a8d0f9.php:43 #39 __TwigTemplate_9981b839df44ee7999d46abd52bdaf0d942e7f973bb94ab3f62bdb4e28d6b5f6:block_particle in /var/www/clients/client15/web36/web/wp-content/plugins/gantry5/src/vendor/twig/twig/src/Template.php:216 #38 Twig\Template:displayBlock in /var/www/clients/client15/web36/web/wp-content/cache/gantry5/valdargan/twig/c3/c357c9dab18518f5afc0d5084cd590a4839a287ad17d0d4036da98aa378ae6aa.php:73 #37 __TwigTemplate_e48322c0916d6a8cebae383bc5b862d388ea09180b6b70025744a34b0c4f7da3:doDisplay in /var/www/clients/client15/web36/web/wp-content/plugins/gantry5/src/vendor/twig/twig/src/Template.php:455 #36 Twig\Template:displayWithErrorHandling in /var/www/clients/client15/web36/web/wp-content/plugins/gantry5/src/vendor/twig/twig/src/Template.php:422 #35 Twig\Template:display in /var/www/clients/client15/web36/web/wp-content/cache/gantry5/valdargan/twig/73/73b4f5cf380b0592084fada21a01ec5306c3a2ed3698c9b7cf096323e3a8d0f9.php:35 #34 __TwigTemplate_9981b839df44ee7999d46abd52bdaf0d942e7f973bb94ab3f62bdb4e28d6b5f6:doDisplay in /var/www/clients/client15/web36/web/wp-content/plugins/gantry5/src/vendor/twig/twig/src/Template.php:455 #33 Twig\Template:displayWithErrorHandling in /var/www/clients/client15/web36/web/wp-content/plugins/gantry5/src/vendor/twig/twig/src/Template.php:422 #32 Twig\Template:display in /var/www/clients/client15/web36/web/wp-content/cache/gantry5/valdargan/twig/94/94d3f72885b3ecd2349f2c1f2d4a06bf9a5dc599b7a106b05d95f73527aba066.php:53 #31 __TwigTemplate_c272d04661190c373646d41af3dfe514161c2d4f26d21fbbb7bfd98d8703dc4c:doDisplay in /var/www/clients/client15/web36/web/wp-content/plugins/gantry5/src/vendor/twig/twig/src/Template.php:455 #30 Twig\Template:displayWithErrorHandling in /var/www/clients/client15/web36/web/wp-content/plugins/gantry5/src/vendor/twig/twig/src/Template.php:422 #29 Twig\Template:display in /var/www/clients/client15/web36/web/wp-content/cache/gantry5/valdargan/twig/1f/1f7b8a6ebd91722e3fd9ef74c2472005b7314b719413d0f2d425dae36f4c8323.php:75 #28 __TwigTemplate_fd50919befd26df80b638e6138dbd92115252d6a7cd574528ade547acdda748d:doDisplay in /var/www/clients/client15/web36/web/wp-content/plugins/gantry5/src/vendor/twig/twig/src/Template.php:455 #27 Twig\Template:displayWithErrorHandling in /var/www/clients/client15/web36/web/wp-content/plugins/gantry5/src/vendor/twig/twig/src/Template.php:422 #26 Twig\Template:display in /var/www/clients/client15/web36/web/wp-content/cache/gantry5/valdargan/twig/0d/0d7f41a14de80ee6c5826dc2829bd5054edcd8c54dde873274389c4eea1851e6.php:58 #25 __TwigTemplate_0fad124efa462272710f17ccc7ce4292f412f0ee7210548ccdeb5bae65ad09cb:doDisplay in /var/www/clients/client15/web36/web/wp-content/plugins/gantry5/src/vendor/twig/twig/src/Template.php:455 #24 Twig\Template:displayWithErrorHandling in /var/www/clients/client15/web36/web/wp-content/plugins/gantry5/src/vendor/twig/twig/src/Template.php:422 #23 Twig\Template:display in /var/www/clients/client15/web36/web/wp-content/cache/gantry5/valdargan/twig/f5/f51faa393d740f1adb146a633db08a69b99090b7818ba9efa84ef68f0e09bdf4.php:71 #22 __TwigTemplate_ad8d96aaabab3f82ee15ad88bdc1cbbe98d29eaa9751aa4e1060af314b68bc1b:doDisplay in /var/www/clients/client15/web36/web/wp-content/plugins/gantry5/src/vendor/twig/twig/src/Template.php:455 #21 Twig\Template:displayWithErrorHandling in /var/www/clients/client15/web36/web/wp-content/plugins/gantry5/src/vendor/twig/twig/src/Template.php:422 #20 Twig\Template:display in /var/www/clients/client15/web36/web/wp-content/cache/gantry5/valdargan/twig/35/3597c5f6daa68a93f8eb2aaa92605a5ce92ea200e1aba9f79e49f7511cec4733.php:201 #19 __TwigTemplate_639d85ed89cacdb437b4625a12fa82574a804e884026e61fc2f0dd729e099808:block_page_layout in /var/www/clients/client15/web36/web/wp-content/plugins/gantry5/src/vendor/twig/twig/src/Template.php:216 #18 Twig\Template:displayBlock in /var/www/clients/client15/web36/web/wp-content/cache/gantry5/valdargan/twig/35/3597c5f6daa68a93f8eb2aaa92605a5ce92ea200e1aba9f79e49f7511cec4733.php:88 #17 __TwigTemplate_639d85ed89cacdb437b4625a12fa82574a804e884026e61fc2f0dd729e099808:doDisplay in /var/www/clients/client15/web36/web/wp-content/plugins/gantry5/src/vendor/twig/twig/src/Template.php:455 #16 Twig\Template:displayWithErrorHandling in /var/www/clients/client15/web36/web/wp-content/plugins/gantry5/src/vendor/twig/twig/src/Template.php:422 #15 Twig\Template:display in /var/www/clients/client15/web36/web/wp-content/cache/gantry5/valdargan/twig/1b/1b505e30c72bb508ae0d4fcef6a8ab8526b92e170bcfefc0cda1c34eccab75d9.php:36 #14 __TwigTemplate_676715d24b47d2f08a03beda99965fbe399f3640cd615494a678ed0b8a611406:doDisplay in /var/www/clients/client15/web36/web/wp-content/plugins/gantry5/src/vendor/twig/twig/src/Template.php:455 #13 Twig\Template:displayWithErrorHandling in /var/www/clients/client15/web36/web/wp-content/plugins/gantry5/src/vendor/twig/twig/src/Template.php:422 #12 Twig\Template:display in /var/www/clients/client15/web36/web/wp-content/cache/gantry5/valdargan/twig/b4/b4f33fb0836f611f5e1cbcad512a049dcbcd958a2ea781f8f1a0bbc31748ff69.php:40 #11 __TwigTemplate_1063cb1d050b2774122e9e8f51352c74d177d6e71d5dd88963e970d457af2c1c:doDisplay in /var/www/clients/client15/web36/web/wp-content/plugins/gantry5/src/vendor/twig/twig/src/Template.php:455 #10 Twig\Template:displayWithErrorHandling in /var/www/clients/client15/web36/web/wp-content/plugins/gantry5/src/vendor/twig/twig/src/Template.php:422 #9 Twig\Template:display in /var/www/clients/client15/web36/web/wp-content/plugins/gantry5/src/vendor/twig/twig/src/Template.php:434 #8 Twig\Template:render in /var/www/clients/client15/web36/web/wp-content/plugins/gantry5/src/vendor/twig/twig/src/TemplateWrapper.php:47 #7 Twig\TemplateWrapper:render in /var/www/clients/client15/web36/web/wp-content/plugins/gantry5/src/vendor/timber/timber/lib/Loader.php:75 #6 Timber\Loader:render in /var/www/clients/client15/web36/web/wp-content/plugins/gantry5/src/vendor/timber/timber/lib/Timber.php:333 #5 Timber\Timber:compile in /var/www/clients/client15/web36/web/wp-content/plugins/gantry5/src/vendor/timber/timber/lib/Timber.php:377 #4 Timber\Timber:fetch in /var/www/clients/client15/web36/web/wp-content/plugins/gantry5/src/vendor/timber/timber/lib/Timber.php:404 #3 Timber\Timber:render in /var/www/clients/client15/web36/web/wp-content/themes/g5_helium/page.php:41 #2 include in /var/www/clients/client15/web36/web/wp-includes/template-loader.php:106 #1 require_once in /var/www/clients/client15/web36/web/wp-blog-header.php:19 #0 require in /var/www/clients/client15/web36/web/index.php:17
Stack frames (53)
52
Error
/var/www/clients/client15/web36/web/wp-content/themes/valdargan/functions.php160
51
vda_header
/var/www/clients/client15/web36/web/wp-includes/shortcodes.php343
50
do_shortcode_tag
[internal]0
49
preg_replace_callback
/var/www/clients/client15/web36/web/wp-includes/shortcodes.php218
48
do_shortcode
/var/www/clients/client15/web36/web/wp-includes/class-wp-hook.php289
47
WP_Hook apply_filters
/var/www/clients/client15/web36/web/wp-includes/plugin.php206
46
apply_filters
/var/www/clients/client15/web36/web/wp-includes/widgets/class-wp-widget-custom-html.php147
45
WP_Widget_Custom_HTML widget
/var/www/clients/client15/web36/web/wp-includes/class-wp-widget.php380
44
WP_Widget display_callback
/var/www/clients/client15/web36/web/wp-includes/widgets.php805
43
dynamic_sidebar
/classes/Gantry/WordPress/Widgets.php90
42
Gantry\WordPress\Widgets displayPosition
/classes/Gantry/Framework/Platform.php248
41
Gantry\Framework\Platform displayWidgets
/vendor/twig/twig/src/Template.php704
40
Twig\Template getAttribute
/var/www/clients/client15/web36/web/wp-content/cache/gantry5/valdargan/twig/73/73b4f5cf380b0592084fada21a01ec5306c3a2ed3698c9b7cf096323e3a8d0f9.php43
39
__TwigTemplate_9981b839df44ee7999d46abd52bdaf0d942e7f973bb94ab3f62bdb4e28d6b5f6 block_particle
/vendor/twig/twig/src/Template.php216
38
Twig\Template displayBlock
/var/www/clients/client15/web36/web/wp-content/cache/gantry5/valdargan/twig/c3/c357c9dab18518f5afc0d5084cd590a4839a287ad17d0d4036da98aa378ae6aa.php73
37
__TwigTemplate_e48322c0916d6a8cebae383bc5b862d388ea09180b6b70025744a34b0c4f7da3 doDisplay
/vendor/twig/twig/src/Template.php455
36
Twig\Template displayWithErrorHandling
/vendor/twig/twig/src/Template.php422
35
Twig\Template display
/var/www/clients/client15/web36/web/wp-content/cache/gantry5/valdargan/twig/73/73b4f5cf380b0592084fada21a01ec5306c3a2ed3698c9b7cf096323e3a8d0f9.php35
34
__TwigTemplate_9981b839df44ee7999d46abd52bdaf0d942e7f973bb94ab3f62bdb4e28d6b5f6 doDisplay
/vendor/twig/twig/src/Template.php455
33
Twig\Template displayWithErrorHandling
/vendor/twig/twig/src/Template.php422
32
Twig\Template display
/var/www/clients/client15/web36/web/wp-content/cache/gantry5/valdargan/twig/94/94d3f72885b3ecd2349f2c1f2d4a06bf9a5dc599b7a106b05d95f73527aba066.php53
31
__TwigTemplate_c272d04661190c373646d41af3dfe514161c2d4f26d21fbbb7bfd98d8703dc4c doDisplay
/vendor/twig/twig/src/Template.php455
30
Twig\Template displayWithErrorHandling
/vendor/twig/twig/src/Template.php422
29
Twig\Template display
/var/www/clients/client15/web36/web/wp-content/cache/gantry5/valdargan/twig/1f/1f7b8a6ebd91722e3fd9ef74c2472005b7314b719413d0f2d425dae36f4c8323.php75
28
__TwigTemplate_fd50919befd26df80b638e6138dbd92115252d6a7cd574528ade547acdda748d doDisplay
/vendor/twig/twig/src/Template.php455
27
Twig\Template displayWithErrorHandling
/vendor/twig/twig/src/Template.php422
26
Twig\Template display
/var/www/clients/client15/web36/web/wp-content/cache/gantry5/valdargan/twig/0d/0d7f41a14de80ee6c5826dc2829bd5054edcd8c54dde873274389c4eea1851e6.php58
25
__TwigTemplate_0fad124efa462272710f17ccc7ce4292f412f0ee7210548ccdeb5bae65ad09cb doDisplay
/vendor/twig/twig/src/Template.php455
24
Twig\Template displayWithErrorHandling
/vendor/twig/twig/src/Template.php422
23
Twig\Template display
/var/www/clients/client15/web36/web/wp-content/cache/gantry5/valdargan/twig/f5/f51faa393d740f1adb146a633db08a69b99090b7818ba9efa84ef68f0e09bdf4.php71
22
__TwigTemplate_ad8d96aaabab3f82ee15ad88bdc1cbbe98d29eaa9751aa4e1060af314b68bc1b doDisplay
/vendor/twig/twig/src/Template.php455
21
Twig\Template displayWithErrorHandling
/vendor/twig/twig/src/Template.php422
20
Twig\Template display
/var/www/clients/client15/web36/web/wp-content/cache/gantry5/valdargan/twig/35/3597c5f6daa68a93f8eb2aaa92605a5ce92ea200e1aba9f79e49f7511cec4733.php201
19
__TwigTemplate_639d85ed89cacdb437b4625a12fa82574a804e884026e61fc2f0dd729e099808 block_page_layout
/vendor/twig/twig/src/Template.php216
18
Twig\Template displayBlock
/var/www/clients/client15/web36/web/wp-content/cache/gantry5/valdargan/twig/35/3597c5f6daa68a93f8eb2aaa92605a5ce92ea200e1aba9f79e49f7511cec4733.php88
17
__TwigTemplate_639d85ed89cacdb437b4625a12fa82574a804e884026e61fc2f0dd729e099808 doDisplay
/vendor/twig/twig/src/Template.php455
16
Twig\Template displayWithErrorHandling
/vendor/twig/twig/src/Template.php422
15
Twig\Template display
/var/www/clients/client15/web36/web/wp-content/cache/gantry5/valdargan/twig/1b/1b505e30c72bb508ae0d4fcef6a8ab8526b92e170bcfefc0cda1c34eccab75d9.php36
14
__TwigTemplate_676715d24b47d2f08a03beda99965fbe399f3640cd615494a678ed0b8a611406 doDisplay
/vendor/twig/twig/src/Template.php455
13
Twig\Template displayWithErrorHandling
/vendor/twig/twig/src/Template.php422
12
Twig\Template display
/var/www/clients/client15/web36/web/wp-content/cache/gantry5/valdargan/twig/b4/b4f33fb0836f611f5e1cbcad512a049dcbcd958a2ea781f8f1a0bbc31748ff69.php40
11
__TwigTemplate_1063cb1d050b2774122e9e8f51352c74d177d6e71d5dd88963e970d457af2c1c doDisplay
/vendor/twig/twig/src/Template.php455
10
Twig\Template displayWithErrorHandling
/vendor/twig/twig/src/Template.php422
9
Twig\Template display
/vendor/twig/twig/src/Template.php434
8
Twig\Template render
/vendor/twig/twig/src/TemplateWrapper.php47
7
Twig\TemplateWrapper render
/vendor/timber/timber/lib/Loader.php75
6
Timber\Loader render
/vendor/timber/timber/lib/Timber.php333
5
Timber\Timber compile
/vendor/timber/timber/lib/Timber.php377
4
Timber\Timber fetch
/vendor/timber/timber/lib/Timber.php404
3
Timber\Timber render
/var/www/clients/client15/web36/web/wp-content/themes/g5_helium/page.php41
2
include
/var/www/clients/client15/web36/web/wp-includes/template-loader.php106
1
require_once
/var/www/clients/client15/web36/web/wp-blog-header.php19
0
require
/var/www/clients/client15/web36/web/index.php17
            </div>
        <?php            
        }
    }
}

add_shortcode('vda_header','vda_header');

function vda_header() {
    global $post;
    
    if(get_option('page_on_front')!=$post->id) {
        $img=wp_get_attachment_image_src( get_post_thumbnail_id($post->ID),'el_header');
        if(!$img) {
            $img=wp_get_attachment_image_src( get_post_thumbnail_id(get_option('page_on_front')),'el_header');  
        }
        if($img) {
            $title=$post->post_title;
            $excerpt=$post->post_excerpt;
            if(is_shop() && $title=="") {
                $title=pll__('Vins du Maroc');
            }
            if(is_shop() && $excerpt=="") {
                $excerpt=pll__('Découvrez nos vins');
            }
            if($post->post_type=="product") {
                $excerpt=get_term_by( 'id', get_the_terms($post->product_category, 'product_cat')[0]->term_id, 'product_cat' )->name ;
            }
    ?>
    <div data-vc-full-width="true" data-vc-full-width-init="true" data-vc-stretch-content="true" class="vc_row wpb_row vc_row-fluid vda_header wpb_animate wpb_zoomIn zoomIn vc_row-no-padding" style="background-image:url(<?php echo $img[0]; ?>);">
        <div class="tp-dottedoverlay twoxtwo"></div>
        <div class="wpb_column vc_column_container vc_col-sm-12">
            <div class="vc_column-inner">
                <div class="wpb_wrapper">
                    <div class="wpb_text_column wpb_content_element ">
                        <div class="wpb_wrapper">
                        <h1><?php echo $title; ?></h1>
                        <h2><?php echo $excerpt; ?></h2>
                        </div>
                    </div>
     * Filters whether to call a shortcode callback.
     *
     * Returning a non-false value from filter will short-circuit the
     * shortcode generation process, returning that value instead.
     *
     * @since 4.7.0
     *
     * @param false|string $return      Short-circuit return value. Either false or the value to replace the shortcode with.
     * @param string       $tag         Shortcode name.
     * @param array|string $attr        Shortcode attributes array or empty string.
     * @param array        $m           Regular expression match array.
     */
    $return = apply_filters( 'pre_do_shortcode_tag', false, $tag, $attr, $m );
    if ( false !== $return ) {
        return $return;
    }
 
    $content = isset( $m[5] ) ? $m[5] : null;
 
    $output = $m[1] . call_user_func( $shortcode_tags[ $tag ], $attr, $content, $tag ) . $m[6];
 
    /**
     * Filters the output created by a shortcode callback.
     *
     * @since 4.7.0
     *
     * @param string       $output Shortcode output.
     * @param string       $tag    Shortcode name.
     * @param array|string $attr   Shortcode attributes array or empty string.
     * @param array        $m      Regular expression match array.
     */
    return apply_filters( 'do_shortcode_tag', $output, $tag, $attr, $m );
}
 
/**
 * Search only inside HTML elements for shortcodes and process them.
 *
 * Any [ or ] characters remaining inside elements will be HTML encoded
 * to prevent interference with shortcodes that are outside the elements.
 * Assumes $content processed by KSES already.  Users with unfiltered_html
    if ( false === strpos( $content, '[' ) ) {
        return $content;
    }
 
    if ( empty( $shortcode_tags ) || ! is_array( $shortcode_tags ) ) {
        return $content;
    }
 
    // Find all registered tag names in $content.
    preg_match_all( '@\[([^<>&/\[\]\x00-\x20=]++)@', $content, $matches );
    $tagnames = array_intersect( array_keys( $shortcode_tags ), $matches[1] );
 
    if ( empty( $tagnames ) ) {
        return $content;
    }
 
    $content = do_shortcodes_in_html_tags( $content, $ignore_html, $tagnames );
 
    $pattern = get_shortcode_regex( $tagnames );
    $content = preg_replace_callback( "/$pattern/", 'do_shortcode_tag', $content );
 
    // Always restore square braces so we don't break things like <!--[if IE ]>.
    $content = unescape_invalid_shortcodes( $content );
 
    return $content;
}
 
/**
 * Retrieve the shortcode regular expression for searching.
 *
 * The regular expression combines the shortcode tags in the regular expression
 * in a regex class.
 *
 * The regular expression contains 6 different sub matches to help with parsing.
 *
 * 1 - An extra [ to allow for escaping shortcodes with double [[]]
 * 2 - The shortcode name
 * 3 - The shortcode argument list
 * 4 - The self closing /
 * 5 - The content of a shortcode when it wraps some content.
 
        $this->iterations[ $nesting_level ] = array_keys( $this->callbacks );
        $num_args                           = count( $args );
 
        do {
            $this->current_priority[ $nesting_level ] = current( $this->iterations[ $nesting_level ] );
            $priority                                 = $this->current_priority[ $nesting_level ];
 
            foreach ( $this->callbacks[ $priority ] as $the_ ) {
                if ( ! $this->doing_action ) {
                    $args[0] = $value;
                }
 
                // Avoid the array_slice() if possible.
                if ( 0 == $the_['accepted_args'] ) {
                    $value = call_user_func( $the_['function'] );
                } elseif ( $the_['accepted_args'] >= $num_args ) {
                    $value = call_user_func_array( $the_['function'], $args );
                } else {
                    $value = call_user_func_array( $the_['function'], array_slice( $args, 0, (int) $the_['accepted_args'] ) );
                }
            }
        } while ( false !== next( $this->iterations[ $nesting_level ] ) );
 
        unset( $this->iterations[ $nesting_level ] );
        unset( $this->current_priority[ $nesting_level ] );
 
        $this->nesting_level--;
 
        return $value;
    }
 
    /**
     * Calls the callback functions that have been added to an action hook.
     *
     * @since 4.7.0
     *
     * @param array $args Parameters to pass to the callback functions.
     */
    public function do_action( $args ) {
    if ( isset( $wp_filter['all'] ) ) {
        $wp_current_filter[] = $tag;
        _wp_call_all_hook( $args );
    }
 
    if ( ! isset( $wp_filter[ $tag ] ) ) {
        if ( isset( $wp_filter['all'] ) ) {
            array_pop( $wp_current_filter );
        }
        return $value;
    }
 
    if ( ! isset( $wp_filter['all'] ) ) {
        $wp_current_filter[] = $tag;
    }
 
    // Don't pass the tag name to WP_Hook.
    array_shift( $args );
 
    $filtered = $wp_filter[ $tag ]->apply_filters( $value, $args );
 
    array_pop( $wp_current_filter );
 
    return $filtered;
}
 
/**
 * Calls the callback functions that have been added to a filter hook, specifying arguments in an array.
 *
 * @since 3.0.0
 *
 * @see apply_filters() This function is identical, but the arguments passed to the
 * functions hooked to `$tag` are supplied using an array.
 *
 * @global array $wp_filter         Stores all of the filters and actions.
 * @global array $wp_current_filter Stores the list of current filters with the current one last.
 *
 * @param string $tag  The name of the filter hook.
 * @param array  $args The arguments supplied to the functions hooked to $tag.
 * @return mixed The filtered value after all hooked functions are applied to it.
        add_filter( 'shortcode_atts_gallery', array( $this, '_filter_gallery_shortcode_attrs' ) );
 
        $instance = array_merge( $this->default_instance, $instance );
 
        /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */
        $title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
 
        // Prepare instance data that looks like a normal Text widget.
        $simulated_text_widget_instance = array_merge(
            $instance,
            array(
                'text'   => isset( $instance['content'] ) ? $instance['content'] : '',
                'filter' => false, // Because wpautop is not applied.
                'visual' => false, // Because it wasn't created in TinyMCE.
            )
        );
        unset( $simulated_text_widget_instance['content'] ); // Was moved to 'text' prop.
 
        /** This filter is documented in wp-includes/widgets/class-wp-widget-text.php */
        $content = apply_filters( 'widget_text', $instance['content'], $simulated_text_widget_instance, $this );
 
        // Adds noreferrer and noopener relationships, without duplicating values, to all HTML A elements that have a target.
        $content = wp_targeted_link_rel( $content );
 
        /**
         * Filters the content of the Custom HTML widget.
         *
         * @since 4.8.1
         *
         * @param string                $content  The widget content.
         * @param array                 $instance Array of settings for the current widget.
         * @param WP_Widget_Custom_HTML $this     Current Custom HTML widget instance.
         */
        $content = apply_filters( 'widget_custom_html_content', $content, $instance, $this );
 
        // Restore post global.
        $post = $original_post;
        remove_filter( 'shortcode_atts_gallery', array( $this, '_filter_gallery_shortcode_attrs' ) );
 
        // Inject the Text widget's container class name alongside this widget's class name for theme styling compatibility.
             * Returning false will effectively short-circuit display of the widget.
             *
             * @since 2.8.0
             *
             * @param array     $instance The current widget instance's settings.
             * @param WP_Widget $this     The current widget instance.
             * @param array     $args     An array of default widget arguments.
             */
            $instance = apply_filters( 'widget_display_callback', $instance, $this, $args );
 
            if ( false === $instance ) {
                return;
            }
 
            $was_cache_addition_suspended = wp_suspend_cache_addition();
            if ( $this->is_preview() && ! $was_cache_addition_suspended ) {
                wp_suspend_cache_addition( true );
            }
 
            $this->widget( $args, $instance );
 
            if ( $this->is_preview() ) {
                wp_suspend_cache_addition( $was_cache_addition_suspended );
            }
        }
    }
 
    /**
     * Handles changed settings (Do NOT override).
     *
     * @since 2.8.0
     *
     * @global array $wp_registered_widgets
     *
     * @param int $deprecated Not used.
     */
    public function update_callback( $deprecated = 1 ) {
        global $wp_registered_widgets;
 
        $all_instances = $this->get_settings();
         *
         * @param array $widget_id {
         *     An associative array of widget arguments.
         *
         *     @type string   $name        Name of the widget.
         *     @type string   $id          Widget ID.
         *     @type callable $callback    When the hook is fired on the front end, $callback is an array
         *                                 containing the widget object. Fired on the back end, $callback
         *                                 is 'wp_widget_control', see $_callback.
         *     @type array    $params      An associative array of multi-widget arguments.
         *     @type string   $classname   CSS class applied to the widget container.
         *     @type string   $description The widget description.
         *     @type array    $_callback   When the hook is fired on the back end, $_callback is populated
         *                                 with an array containing the widget object, see $callback.
         * }
         */
        do_action( 'dynamic_sidebar', $wp_registered_widgets[ $id ] );
 
        if ( is_callable( $callback ) ) {
            call_user_func_array( $callback, $params );
            $did_one = true;
        }
    }
 
    /**
     * Fires after widgets are rendered in a dynamic sidebar.
     *
     * Note: The action also fires for empty sidebars, and on both the front end
     * and back end, including the Inactive Widgets sidebar on the Widgets screen.
     *
     * @since 3.9.0
     *
     * @param int|string $index       Index, name, or ID of the dynamic sidebar.
     * @param bool       $has_widgets Whether the sidebar is populated with widgets.
     *                                Default true.
     */
    do_action( 'dynamic_sidebar_after', $index, true );
 
    /**
     * Filters whether a sidebar has widgets.
                    $args = apply_filters('dynamic_sidebar_params', $args);
 
                    // Grab the content of the plugin.
                    ob_start();
                    call_user_func_array($callback, $args);
                    $contents = ob_get_clean();
 
                    // As we already rendered content, we can later just display it.
                    $wp_registered_widgets[$id]['callback'] = function () use ($contents) {
                        echo $contents;
                    };
                }
            }
 
            $html = '@@DEFERRED@@';
 
        } else {
            // Display whole sidebar.
            ob_start();
            \dynamic_sidebar($key);
            $html = ob_get_clean();
        }
 
        // Remove sidebar params filter.
        \remove_filter('dynamic_sidebar_params', ['Gantry\Wordpress\Widgets', 'sidebarChromeFilter'], -1000);
 
        return $html;
    }
 
    public static function displayWidget($instance = [], array $params = [])
    {
        if (is_string($instance)) {
            $instance = json_decode($instance, true);
        }
        if (!isset($instance['type']) || $instance['type'] !== 'widget' || !isset($instance['widget']) || !isset($instance['options'])) {
            return null;
        }
 
        $options = $instance['options'];
 
            'hierarchical'             => 1,
            'taxonomy'                 => 'category',
            'pad_counts'               => 1
        ];
 
        $args = wp_parse_args( apply_filters( 'gantry5_form_field_selectize_categories_args', $args ), $default );
 
        $categories = get_categories( $args );
        $new_categories = [];
 
        foreach( $categories as $cat ) {
            $new_categories[$cat->cat_ID] = $cat->name;
        }
 
        return apply_filters( 'gantry5_form_field_selectize_categories', $new_categories );
    }
 
    public function displayWidgets($key, array $params = [])
    {
        return Widgets::displayPosition($key, $params);
    }
 
    public function displayWidget($instance = [], array $params = [])
    {
        return Widgets::displayWidget($instance, $params);
    }
 
    public function listWidgets()
    {
        return Widgets::listWidgets();
    }
 
    public function displaySystemMessages($params = [])
    {
        /** @var Theme $theme */
        $theme = $this->container['theme'];
 
        /** @var Messages $messages */
        $messages = $this->container['messages'];
 
            }
 
            throw new RuntimeError(sprintf('Neither the property "%1$s" nor one of the methods "%1$s()", "get%1$s()"/"is%1$s()" or "__call()" exist and have public access in class "%2$s".', $item, $class), -1, $this->getSourceContext());
        }
 
        if ($isDefinedTest) {
            return true;
        }
 
        if ($this->env->hasExtension('\Twig\Extension\SandboxExtension')) {
            $this->env->getExtension('\Twig\Extension\SandboxExtension')->checkMethodAllowed($object, $method);
        }
 
        // Some objects throw exceptions when they have __call, and the method we try
        // to call is not supported. If ignoreStrictCheck is true, we should return null.
        try {
            if (!$arguments) {
                $ret = $object->$method();
            } else {
                $ret = \call_user_func_array([$object, $method], $arguments);
            }
        } catch (\BadMethodCallException $e) {
            if ($call && ($ignoreStrictCheck || !$this->env->isStrictVariables())) {
                return;
            }
            throw $e;
        }
 
        // @deprecated in 1.28
        if ($object instanceof \Twig_TemplateInterface) {
            $self = $object->getTemplateName() === $this->getTemplateName();
            $message = sprintf('Calling "%s" on template "%s" from template "%s" is deprecated since version 1.28 and won\'t be supported anymore in 2.0.', $item, $object->getTemplateName(), $this->getTemplateName());
            if ('renderBlock' === $method || 'displayBlock' === $method) {
                $message .= sprintf(' Use block("%s"%s) instead).', $arguments[0], $self ? '' : ', template');
            } elseif ('hasBlock' === $method) {
                $message .= sprintf(' Use "block("%s"%s) is defined" instead).', $arguments[0], $self ? '' : ', template');
            } elseif ('render' === $method || 'display' === $method) {
                $message .= sprintf(' Use include("%s") instead).', $object->getTemplateName());
            }
            @trigger_error($message, E_USER_DEPRECATED);
    }
 
    protected function doGetParent(array $context)
    {
        // line 1
        return "@nucleus/partials/particle.html.twig";
    }
 
    protected function doDisplay(array $context, array $blocks = [])
    {
        $this->parent = $this->loadTemplate("@nucleus/partials/particle.html.twig", "@particles/position.html.twig", 1);
        $this->parent->display($context, array_merge($this->blocks, $blocks));
    }
 
    // line 3
    public function block_particle($context, array $blocks = [])
    {
        // line 4
        echo "    ";
        echo $this->getAttribute($this->getAttribute(($context["gantry"] ?? null), "platform", []), "displayWidgets", [0 => $this->getAttribute(($context["particle"] ?? null), "key", []), 1 => ["chrome" => (($this->getAttribute(($context["particle"] ?? null), "chrome", [], "any", true, true)) ? (_twig_default_filter($this->getAttribute(($context["particle"] ?? null), "chrome", []), "gantry")) : ("gantry")), "prepare_layout" => ($context["prepare_layout"] ?? null)]], "method");
        echo "
";
    }
 
    public function getTemplateName()
    {
        return "@particles/position.html.twig";
    }
 
    public function isTraitable()
    {
        return false;
    }
 
    public function getDebugInfo()
    {
        return array (  42 => 4,  39 => 3,  29 => 1,);
    }
 
    /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */
 
        if ($useBlocks && isset($blocks[$name])) {
            $template = $blocks[$name][0];
            $block = $blocks[$name][1];
        } elseif (isset($this->blocks[$name])) {
            $template = $this->blocks[$name][0];
            $block = $this->blocks[$name][1];
        } else {
            $template = null;
            $block = null;
        }
 
        // avoid RCEs when sandbox is enabled
        if (null !== $template && !$template instanceof self) {
            throw new \LogicException('A block must be a method on a \Twig\Template instance.');
        }
 
        if (null !== $template) {
            try {
                $template->$block($context, $blocks);
            } catch (Error $e) {
                if (!$e->getSourceContext()) {
                    $e->setSourceContext($template->getSourceContext());
                }
 
                // this is mostly useful for \Twig\Error\LoaderError exceptions
                // see \Twig\Error\LoaderError
                if (-1 === $e->getTemplateLine()) {
                    $e->guess();
                }
 
                throw $e;
            } catch (\Exception $e) {
                $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $template->getSourceContext(), $e);
                $e->guess();
 
                throw $e;
            }
        } elseif (false !== $parent = $this->getParent($context)) {
            $parent->displayBlock($name, $context, array_merge($this->blocks, $blocks), false);
        $assetFunction($content, $location, $priority);
        // line 9
        $assetFunction = $this->env->getFunction('parse_assets')->getCallable();
        $assetVariables = [];
        if ($assetVariables && !is_array($assetVariables)) {
            throw new UnexpectedValueException('{% scripts with x %}: x is not an array');
        }
        $location = "footer";
        if ($location && !is_string($location)) {
            throw new UnexpectedValueException('{% scripts in x %}: x is not a string');
        }
        $priority = isset($assetVariables['priority']) ? $assetVariables['priority'] : 0;
        ob_start();
        // line 10
        echo "    ";
        $this->displayBlock('javascript_footer', $context, $blocks);
        $content = ob_get_clean();
        $assetFunction($content, $location, $priority);
        // line 14
        $this->displayBlock('particle', $context, $blocks);
    }
 
    // line 2
    public function block_stylesheets($context, array $blocks = [])
    {
        // line 3
        echo "    ";
    }
 
    // line 5
    public function block_javascript($context, array $blocks = [])
    {
        // line 6
        echo "    ";
    }
 
    // line 10
    public function block_javascript_footer($context, array $blocks = [])
    {
        // line 11
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
            $this->doDisplay($context, $blocks);
        } catch (Error $e) {
            if (!$e->getSourceContext()) {
                $e->setSourceContext($this->getSourceContext());
            }
 
            // this is mostly useful for \Twig\Error\LoaderError exceptions
            // see \Twig\Error\LoaderError
            if (-1 === $e->getTemplateLine()) {
                $e->guess();
            }
 
            throw $e;
        } catch (\Exception $e) {
            $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
            $e->guess();
 
            throw $e;
        }
    }
 
    {
        return $this;
    }
 
    /**
     * Returns all blocks.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @return array An array of blocks
     */
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
{
    public function __construct(Environment $env)
    {
        parent::__construct($env);
 
        $this->blocks = [
            'particle' => [$this, 'block_particle'],
        ];
    }
 
    protected function doGetParent(array $context)
    {
        // line 1
        return "@nucleus/partials/particle.html.twig";
    }
 
    protected function doDisplay(array $context, array $blocks = [])
    {
        $this->parent = $this->loadTemplate("@nucleus/partials/particle.html.twig", "@particles/position.html.twig", 1);
        $this->parent->display($context, array_merge($this->blocks, $blocks));
    }
 
    // line 3
    public function block_particle($context, array $blocks = [])
    {
        // line 4
        echo "    ";
        echo $this->getAttribute($this->getAttribute(($context["gantry"] ?? null), "platform", []), "displayWidgets", [0 => $this->getAttribute(($context["particle"] ?? null), "key", []), 1 => ["chrome" => (($this->getAttribute(($context["particle"] ?? null), "chrome", [], "any", true, true)) ? (_twig_default_filter($this->getAttribute(($context["particle"] ?? null), "chrome", []), "gantry")) : ("gantry")), "prepare_layout" => ($context["prepare_layout"] ?? null)]], "method");
        echo "
";
    }
 
    public function getTemplateName()
    {
        return "@particles/position.html.twig";
    }
 
    public function isTraitable()
    {
        return false;
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
            $this->doDisplay($context, $blocks);
        } catch (Error $e) {
            if (!$e->getSourceContext()) {
                $e->setSourceContext($this->getSourceContext());
            }
 
            // this is mostly useful for \Twig\Error\LoaderError exceptions
            // see \Twig\Error\LoaderError
            if (-1 === $e->getTemplateLine()) {
                $e->guess();
            }
 
            throw $e;
        } catch (\Exception $e) {
            $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
            $e->guess();
 
            throw $e;
        }
    }
 
    {
        return $this;
    }
 
    /**
     * Returns all blocks.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @return array An array of blocks
     */
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                echo "        ";
                $context["enabled"] = $this->getAttribute($this->getAttribute(($context["gantry"] ?? null), "config", []), "get", [0 => (("particles." . $this->getAttribute(($context["segment"] ?? null), "type", [])) . ".enabled"), 1 => 1], "method");
                // line 4
                echo "        ";
                $context["particle"] = $this->getAttribute($this->getAttribute(($context["gantry"] ?? null), "config", []), "getJoined", [0 => ("particles." . $this->getAttribute(($context["segment"] ?? null), "type", [])), 1 => $this->getAttribute(($context["segment"] ?? null), "attributes", [])], "method");
                // line 5
                echo "    ";
            }
            // line 6
            echo "
    ";
            // line 7
            ob_start(function () { return ''; });
            // line 8
            echo "        ";
            if ((($context["enabled"] ?? null) && ((null === $this->getAttribute($this->getAttribute(($context["segment"] ?? null), "attributes", []), "enabled", [])) || $this->getAttribute($this->getAttribute(($context["segment"] ?? null), "attributes", []), "enabled", [])))) {
                // line 9
                echo "            ";
                $this->loadTemplate([0 => (("particles/" . (($this->getAttribute(($context["segment"] ?? null), "subtype", [], "any", true, true)) ? (_twig_default_filter($this->getAttribute(($context["segment"] ?? null), "subtype", []), "position")) : ("position"))) . ".html.twig"), 1 => (("@particles/" . (($this->getAttribute(                // line 10
($context["segment"] ?? null), "subtype", [], "any", true, true)) ? (_twig_default_filter($this->getAttribute(($context["segment"] ?? null), "subtype", []), "position")) : ("position"))) . ".html.twig")], "@nucleus/content/position.html.twig", 9)->display($context);
                // line 11
                echo "        ";
            }
            // line 12
            echo "    ";
            $context["html"] = ('' === $tmp = ob_get_clean()) ? '' : new Markup($tmp, $this->env->getCharset());
            // line 14
            if (twig_trim_filter(($context["html"] ?? null))) {
                // line 15
                echo "        ";
                if (($this->getAttribute(($context["gantry"] ?? null), "debug", []) && $this->getAttribute($this->getAttribute(($context["segment"] ?? null), "attributes", []), "key", []))) {
                    echo "<!-- START POSITION ";
                    echo $this->getAttribute($this->getAttribute(($context["segment"] ?? null), "attributes", []), "key", []);
                    echo " -->";
                }
                // line 16
                echo "
        <div class=\"g-content";
                // line 17
                echo (($this->getAttribute(($context["segment"] ?? null), "classes", [])) ? ((" " . twig_escape_filter($this->env, twig_join_filter($this->getAttribute(($context["segment"] ?? null), "classes", []), " ")))) : (""));
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
            $this->doDisplay($context, $blocks);
        } catch (Error $e) {
            if (!$e->getSourceContext()) {
                $e->setSourceContext($this->getSourceContext());
            }
 
            // this is mostly useful for \Twig\Error\LoaderError exceptions
            // see \Twig\Error\LoaderError
            if (-1 === $e->getTemplateLine()) {
                $e->guess();
            }
 
            throw $e;
        } catch (\Exception $e) {
            $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
            $e->guess();
 
            throw $e;
        }
    }
 
    {
        return $this;
    }
 
    /**
     * Returns all blocks.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @return array An array of blocks
     */
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
            if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
                $length = count($context['_seq']);
                $context['loop']['revindex0'] = $length - 1;
                $context['loop']['revindex'] = $length;
                $context['loop']['length'] = $length;
                $context['loop']['last'] = 1 === $length;
            }
            foreach ($context['_seq'] as $context["_key"] => $context["segment"]) {
                // line 10
                echo "            ";
                if ($this->getAttribute($context["segment"], "content", [])) {
                    // line 11
                    echo "                ";
                    echo $this->getAttribute($context["segment"], "content", []);
                    echo "
            ";
                } else {
                    // line 13
                    echo "                ";
                    $this->loadTemplate([0 => (("@nucleus/content/" . $this->getAttribute($context["segment"], "type", [])) . ".html.twig"), 1 => (("@nucleus/layout/" . $this->getAttribute($context["segment"], "type", [])) . ".html.twig")], "@nucleus/layout/block.html.twig", 13)->display(twig_array_merge($context, ["segments" => $this->getAttribute($context["segment"], "children", [])]));
                    // line 14
                    echo "            ";
                }
                // line 15
                echo "        ";
                ++$context['loop']['index0'];
                ++$context['loop']['index'];
                $context['loop']['first'] = false;
                if (isset($context['loop']['length'])) {
                    --$context['loop']['revindex0'];
                    --$context['loop']['revindex'];
                    $context['loop']['last'] = 0 === $context['loop']['revindex0'];
                }
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_iterated'], $context['_key'], $context['segment'], $context['_parent'], $context['loop']);
            $context = array_intersect_key($context, $_parent) + $_parent;
            // line 16
            echo "    ";
        }
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
            $this->doDisplay($context, $blocks);
        } catch (Error $e) {
            if (!$e->getSourceContext()) {
                $e->setSourceContext($this->getSourceContext());
            }
 
            // this is mostly useful for \Twig\Error\LoaderError exceptions
            // see \Twig\Error\LoaderError
            if (-1 === $e->getTemplateLine()) {
                $e->guess();
            }
 
            throw $e;
        } catch (\Exception $e) {
            $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
            $e->guess();
 
            throw $e;
        }
    }
 
    {
        return $this;
    }
 
    /**
     * Returns all blocks.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @return array An array of blocks
     */
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
            echo "        ";
            $context['_parent'] = $context;
            $context['_seq'] = twig_ensure_traversable(($context["segments"] ?? null));
            $context['loop'] = [
              'parent' => $context['_parent'],
              'index0' => 0,
              'index'  => 1,
              'first'  => true,
            ];
            if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
                $length = count($context['_seq']);
                $context['loop']['revindex0'] = $length - 1;
                $context['loop']['revindex'] = $length;
                $context['loop']['length'] = $length;
                $context['loop']['last'] = 1 === $length;
            }
            foreach ($context['_seq'] as $context["_key"] => $context["segment"]) {
                // line 7
                echo "            ";
                $this->loadTemplate((("@nucleus/layout/" . $this->getAttribute($context["segment"], "type", [])) . ".html.twig"), "@nucleus/layout/grid.html.twig", 7)->display(twig_array_merge($context, ["segments" => $this->getAttribute($context["segment"], "children", [])]));
                // line 8
                echo "        ";
                ++$context['loop']['index0'];
                ++$context['loop']['index'];
                $context['loop']['first'] = false;
                if (isset($context['loop']['length'])) {
                    --$context['loop']['revindex0'];
                    --$context['loop']['revindex'];
                    $context['loop']['last'] = 0 === $context['loop']['revindex0'];
                }
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_iterated'], $context['_key'], $context['segment'], $context['_parent'], $context['loop']);
            $context = array_intersect_key($context, $_parent) + $_parent;
            // line 9
            echo "    ";
        }
        $context["html"] = ('' === $tmp = ob_get_clean()) ? '' : new Markup($tmp, $this->env->getCharset());
        // line 12
        if (twig_trim_filter(($context["html"] ?? null))) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
            $this->doDisplay($context, $blocks);
        } catch (Error $e) {
            if (!$e->getSourceContext()) {
                $e->setSourceContext($this->getSourceContext());
            }
 
            // this is mostly useful for \Twig\Error\LoaderError exceptions
            // see \Twig\Error\LoaderError
            if (-1 === $e->getTemplateLine()) {
                $e->guess();
            }
 
            throw $e;
        } catch (\Exception $e) {
            $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
            $e->guess();
 
            throw $e;
        }
    }
 
    {
        return $this;
    }
 
    /**
     * Returns all blocks.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @return array An array of blocks
     */
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
            echo "        ";
            $context['_parent'] = $context;
            $context['_seq'] = twig_ensure_traversable(($context["segments"] ?? null));
            $context['loop'] = [
              'parent' => $context['_parent'],
              'index0' => 0,
              'index'  => 1,
              'first'  => true,
            ];
            if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
                $length = count($context['_seq']);
                $context['loop']['revindex0'] = $length - 1;
                $context['loop']['revindex'] = $length;
                $context['loop']['length'] = $length;
                $context['loop']['last'] = 1 === $length;
            }
            foreach ($context['_seq'] as $context["_key"] => $context["segment"]) {
                // line 14
                echo "            ";
                $this->loadTemplate((("@nucleus/layout/" . $this->getAttribute($context["segment"], "type", [])) . ".html.twig"), "@nucleus/layout/section.html.twig", 14)->display(twig_array_merge($context, ["segments" => $this->getAttribute($context["segment"], "children", [])]));
                // line 15
                echo "        ";
                ++$context['loop']['index0'];
                ++$context['loop']['index'];
                $context['loop']['first'] = false;
                if (isset($context['loop']['length'])) {
                    --$context['loop']['revindex0'];
                    --$context['loop']['revindex'];
                    $context['loop']['last'] = 0 === $context['loop']['revindex0'];
                }
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_iterated'], $context['_key'], $context['segment'], $context['_parent'], $context['loop']);
            $context = array_intersect_key($context, $_parent) + $_parent;
            // line 16
            echo "    ";
        }
        $context["html"] = ('' === $tmp = ob_get_clean()) ? '' : new Markup($tmp, $this->env->getCharset());
        // line 19
        if (($this->getAttribute($this->getAttribute(($context["segment"] ?? null), "attributes", []), "sticky", []) || twig_trim_filter(($context["html"] ?? null)))) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
            $this->doDisplay($context, $blocks);
        } catch (Error $e) {
            if (!$e->getSourceContext()) {
                $e->setSourceContext($this->getSourceContext());
            }
 
            // this is mostly useful for \Twig\Error\LoaderError exceptions
            // see \Twig\Error\LoaderError
            if (-1 === $e->getTemplateLine()) {
                $e->guess();
            }
 
            throw $e;
        } catch (\Exception $e) {
            $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
            $e->guess();
 
            throw $e;
        }
    }
 
    {
        return $this;
    }
 
    /**
     * Returns all blocks.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @return array An array of blocks
     */
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
    }
 
    // line 30
    public function block_page_layout($context, array $blocks = [])
    {
        // line 31
        echo "    ";
        $context['_parent'] = $context;
        $context['_seq'] = twig_ensure_traversable(($context["segments"] ?? null));
        $context['loop'] = [
          'parent' => $context['_parent'],
          'index0' => 0,
          'index'  => 1,
          'first'  => true,
        ];
        foreach ($context['_seq'] as $context["_key"] => $context["segment"]) {
            if (($this->getAttribute($context["segment"], "type", []) != "offcanvas")) {
                // line 32
                echo "        ";
                $this->loadTemplate((("@nucleus/layout/" . $this->getAttribute($context["segment"], "type", [])) . ".html.twig"), "@nucleus/page.html.twig", 32)->display(twig_array_merge($context, ["segments" => $this->getAttribute($context["segment"], "children", [])]));
                // line 33
                echo "    ";
                ++$context['loop']['index0'];
                ++$context['loop']['index'];
                $context['loop']['first'] = false;
            }
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['segment'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 34
        echo "    ";
    }
 
    // line 38
    public function block_page_top($context, array $blocks = [])
    {
        // line 39
        echo "    ";
    }
 
        if ($useBlocks && isset($blocks[$name])) {
            $template = $blocks[$name][0];
            $block = $blocks[$name][1];
        } elseif (isset($this->blocks[$name])) {
            $template = $this->blocks[$name][0];
            $block = $this->blocks[$name][1];
        } else {
            $template = null;
            $block = null;
        }
 
        // avoid RCEs when sandbox is enabled
        if (null !== $template && !$template instanceof self) {
            throw new \LogicException('A block must be a method on a \Twig\Template instance.');
        }
 
        if (null !== $template) {
            try {
                $template->$block($context, $blocks);
            } catch (Error $e) {
                if (!$e->getSourceContext()) {
                    $e->setSourceContext($template->getSourceContext());
                }
 
                // this is mostly useful for \Twig\Error\LoaderError exceptions
                // see \Twig\Error\LoaderError
                if (-1 === $e->getTemplateLine()) {
                    $e->guess();
                }
 
                throw $e;
            } catch (\Exception $e) {
                $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $template->getSourceContext(), $e);
                $e->guess();
 
                throw $e;
            }
        } elseif (false !== $parent = $this->getParent($context)) {
            $parent->displayBlock($name, $context, array_merge($this->blocks, $blocks), false);
            }
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['segment'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 18
        ob_start(function () { return ''; });
        // line 19
        echo "    ";
        $this->displayBlock('page_offcanvas', $context, $blocks);
        $context["page_offcanvas"] = ('' === $tmp = ob_get_clean()) ? '' : new Markup($tmp, $this->env->getCharset());
        // line 26
        $context["page_offcanvas"] = ((twig_trim_filter(($context["page_offcanvas"] ?? null))) ? (twig_trim_filter(($context["page_offcanvas"] ?? null))) : (""));
        // line 27
        $context["offcanvas_position"] = ((($context["page_offcanvas"] ?? null)) ? ((($this->getAttribute($this->getAttribute(($context["offcanvas"] ?? null), "attributes", [], "any", false, true), "position", [], "any", true, true)) ? (_twig_default_filter($this->getAttribute($this->getAttribute(($context["offcanvas"] ?? null), "attributes", [], "any", false, true), "position", []), "g-offcanvas-left")) : ("g-offcanvas-left"))) : (""));
        // line 29
        ob_start(function () { return ''; });
        // line 30
        echo "    ";
        $this->displayBlock('page_layout', $context, $blocks);
        $context["page_layout"] = ('' === $tmp = ob_get_clean()) ? '' : new Markup($tmp, $this->env->getCharset());
        // line 37
        ob_start(function () { return ''; });
        // line 38
        echo "    ";
        $this->displayBlock('page_top', $context, $blocks);
        // line 40
        echo "    ";
        echo twig_join_filter($this->getAttribute($this->getAttribute(($context["gantry"] ?? null), "document", []), "getHtml", [0 => "top"], "method"), "
    ");
        echo "
";
        $context["page_top"] = ('' === $tmp = ob_get_clean()) ? '' : new Markup($tmp, $this->env->getCharset());
        // line 43
        ob_start(function () { return ''; });
        // line 44
        echo "    ";
        $this->displayBlock('page_bottom', $context, $blocks);
        // line 46
        echo "    ";
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
            $this->doDisplay($context, $blocks);
        } catch (Error $e) {
            if (!$e->getSourceContext()) {
                $e->setSourceContext($this->getSourceContext());
            }
 
            // this is mostly useful for \Twig\Error\LoaderError exceptions
            // see \Twig\Error\LoaderError
            if (-1 === $e->getTemplateLine()) {
                $e->guess();
            }
 
            throw $e;
        } catch (\Exception $e) {
            $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
            $e->guess();
 
            throw $e;
        }
    }
 
    {
        return $this;
    }
 
    /**
     * Returns all blocks.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @return array An array of blocks
     */
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
    public function __construct(Environment $env)
    {
        parent::__construct($env);
 
        $this->blocks = [
            'page_head' => [$this, 'block_page_head'],
            'page_footer' => [$this, 'block_page_footer'],
        ];
    }
 
    protected function doGetParent(array $context)
    {
        // line 1
        return "@nucleus/page.html.twig";
    }
 
    protected function doDisplay(array $context, array $blocks = [])
    {
        $this->parent = $this->loadTemplate("@nucleus/page.html.twig", "partials/page.html.twig", 1);
        $this->parent->display($context, array_merge($this->blocks, $blocks));
    }
 
    // line 3
    public function block_page_head($context, array $blocks = [])
    {
        // line 4
        if (($context["page_head"] ?? null)) {
            // line 5
            echo "        ";
            echo ($context["page_head"] ?? null);
            echo "
    ";
        } else {
            // line 7
            echo "        ";
            $this->displayParentBlock("page_head", $context, $blocks);
            echo "
    ";
        }
    }
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
            $this->doDisplay($context, $blocks);
        } catch (Error $e) {
            if (!$e->getSourceContext()) {
                $e->setSourceContext($this->getSourceContext());
            }
 
            // this is mostly useful for \Twig\Error\LoaderError exceptions
            // see \Twig\Error\LoaderError
            if (-1 === $e->getTemplateLine()) {
                $e->guess();
            }
 
            throw $e;
        } catch (\Exception $e) {
            $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
            $e->guess();
 
            throw $e;
        }
    }
 
    {
        return $this;
    }
 
    /**
     * Returns all blocks.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @return array An array of blocks
     */
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
        $this->blocks = [
            'content' => [$this, 'block_content'],
        ];
    }
 
    protected function doGetParent(array $context)
    {
        // line 1
        return "partials/page.html.twig";
    }
 
    protected function doDisplay(array $context, array $blocks = [])
    {
        // line 2
        $context["twigTemplate"] = "page.html.twig";
        // line 3
        $context["scope"] = "page";
        // line 1
        $this->parent = $this->loadTemplate("partials/page.html.twig", "page.html.twig", 1);
        $this->parent->display($context, array_merge($this->blocks, $blocks));
    }
 
    // line 5
    public function block_content($context, array $blocks = [])
    {
        // line 6
        echo "
    <div class=\"platform-content\">
        <div class=\"content-wrapper\">
            <section class=\"entry\">
 
                ";
        // line 11
        $this->loadTemplate([0 => (("partials/content-" . ($context["scope"] ?? null)) . ".html.twig"), 1 => "partials/content.html.twig"], "page.html.twig", 11)->display($context);
        // line 12
        echo "
            </section>
        </div> <!-- /content-wrapper -->
    </div>
 
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
            $this->doDisplay($context, $blocks);
        } catch (Error $e) {
            if (!$e->getSourceContext()) {
                $e->setSourceContext($this->getSourceContext());
            }
 
            // this is mostly useful for \Twig\Error\LoaderError exceptions
            // see \Twig\Error\LoaderError
            if (-1 === $e->getTemplateLine()) {
                $e->guess();
            }
 
            throw $e;
        } catch (\Exception $e) {
            $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
            $e->guess();
 
            throw $e;
        }
    }
 
    {
        return $this;
    }
 
    /**
     * Returns all blocks.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @return array An array of blocks
     */
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
     * @internal
     */
    public function __construct(Environment $env, Template $template)
    {
        $this->env = $env;
        $this->template = $template;
    }
 
    /**
     * Renders the template.
     *
     * @param array $context An array of parameters to pass to the template
     *
     * @return string The rendered template
     */
    public function render($context = [])
    {
        // using func_get_args() allows to not expose the blocks argument
        // as it should only be used by internal code
        return $this->template->render($context, \func_num_args() > 1 ? func_get_arg(1) : []);
    }
 
    /**
     * Displays the template.
     *
     * @param array $context An array of parameters to pass to the template
     */
    public function display($context = [])
    {
        // using func_get_args() allows to not expose the blocks argument
        // as it should only be used by internal code
        $this->template->display($context, \func_num_args() > 1 ? func_get_arg(1) : []);
    }
 
    /**
     * Checks if a block is defined.
     *
     * @param string $name    The block name
     * @param array  $context An array of parameters to pass to the template
     *
 
        $key = null;
        $output = false;
        if ( false !== $expires ) {
            ksort($data);
            $key = md5($file.json_encode($data));
            $output = $this->get_cache($key, self::CACHEGROUP, $cache_mode);
        }
 
        if ( false === $output || null === $output ) {
            $twig = $this->get_twig();
            if ( strlen($file) ) {
                $loader = $this->get_loader();
                $result = $loader->getCacheKey($file);
                do_action('timber_loader_render_file', $result);
            }
            $data = apply_filters('timber_loader_render_data', $data);
            $data = apply_filters('timber/loader/render_data', $data, $file);
            $template = $twig->load($file);
            $output = $template->render($data);
        }
 
        if ( false !== $output && false !== $expires && null !== $key ) {
            $this->delete_cache();
            $this->set_cache($key, $output, self::CACHEGROUP, $expires, $cache_mode);
        }
        $output = apply_filters('timber_output', $output);
        return apply_filters('timber/output', $output, $data, $file);
    }
 
    protected function delete_cache() {
        Cleaner::delete_transients();
    }
 
    /**
     * Get first existing template.
     *
     * @param array|string $templates  Name(s) of the Twig template(s) to choose from.
     * @return string|bool             Name of chosen template, otherwise false.
     */
        if ( $via_render ) {
            $file = apply_filters('timber_render_file', $file);
        } else {
            $file = apply_filters('timber_compile_file', $file);
        }
 
        $output = false;
 
        if ($file !== false) {
            if ( is_null($data) ) {
                $data = array();
            }
 
            if ( $via_render ) {
                $data = apply_filters('timber_render_data', $data);
            } else {
                $data = apply_filters('timber_compile_data', $data);
            }
 
            $output = $loader->render($file, $data, $expires, $cache_mode);
        }
 
        do_action('timber_compile_done');
        return $output;
    }
 
    /**
     * Compile a string.
     *
     * @api
     * @example
     * ```php
     * $data = array(
     *     'username' => 'Jane Doe',
     * );
     *
     * $welcome = Timber::compile_string( 'Hi {{ username }}, I’m a string with a custom Twig variable', $data );
     * ```
     * @param string $string A string with Twig variables.
     * @param array  $data   Optional. An array of data to use in Twig template.
        $twig = $dummy_loader->get_twig();
        $template = $twig->createTemplate($string);
        return $template->render($data);
    }
 
    /**
     * Fetch function.
     *
     * @api
     * @param array|string $filenames  Name of the Twig file to render. If this is an array of files, Timber will
     *                                 render the first file that exists.
     * @param array        $data       Optional. An array of data to use in Twig template.
     * @param bool|int     $expires    Optional. In seconds. Use false to disable cache altogether. When passed an
     *                                 array, the first value is used for non-logged in visitors, the second for users.
     *                                 Default false.
     * @param string       $cache_mode Optional. Any of the cache mode constants defined in TimberLoader.
     * @return bool|string The returned output.
     */
    public static function fetch( $filenames, $data = array(), $expires = false, $cache_mode = Loader::CACHE_USE_DEFAULT ) {
        $output = self::compile($filenames, $data, $expires, $cache_mode, true);
        $output = apply_filters('timber_compile_result', $output);
        return $output;
    }
 
    /**
     * Render function.
     *
     * Passes data to a Twig file and echoes the output.
     *
     * @api
     * @example
     * ```php
     * $context = Timber::context();
     *
     * Timber::render( 'index.twig', $context );
     * ```
     * @param array|string $filenames  Name of the Twig file to render. If this is an array of files, Timber will
     *                                 render the first file that exists.
     * @param array        $data       Optional. An array of data to use in Twig template.
     * @param bool|int     $expires    Optional. In seconds. Use false to disable cache altogether. When passed an
     * Passes data to a Twig file and echoes the output.
     *
     * @api
     * @example
     * ```php
     * $context = Timber::context();
     *
     * Timber::render( 'index.twig', $context );
     * ```
     * @param array|string $filenames  Name of the Twig file to render. If this is an array of files, Timber will
     *                                 render the first file that exists.
     * @param array        $data       Optional. An array of data to use in Twig template.
     * @param bool|int     $expires    Optional. In seconds. Use false to disable cache altogether. When passed an
     *                                 array, the first value is used for non-logged in visitors, the second for users.
     *                                 Default false.
     * @param string       $cache_mode Optional. Any of the cache mode constants defined in TimberLoader.
     * @return bool|string The echoed output.
     */
    public static function render( $filenames, $data = array(), $expires = false, $cache_mode = Loader::CACHE_USE_DEFAULT ) {
        $output = self::fetch($filenames, $data, $expires, $cache_mode);
        echo $output;
        return $output;
    }
 
    /**
     * Render a string with Twig variables.
     *
     * @api
     * @example
     * ```php
     * $data = array(
     *     'username' => 'Jane Doe',
     * );
     *
     * Timber::render_string( 'Hi {{ username }}, I’m a string with a custom Twig variable', $data );
     * ```
     * @param string $string A string with Twig variables.
     * @param array  $data   An array of data to use in Twig template.
     * @return bool|string
     */
 *
 * To generate specific templates for your pages you can use:
 * /mytheme/views/page-mypage.html.twig
 * (which will still route through this PHP file)
 * OR
 * /mytheme/page-mypage.php
 * (in which case you'll want to duplicate this file and save to the above path)
 */
 
$gantry = Gantry\Framework\Gantry::instance();
$theme  = $gantry['theme'];
 
// We need to render contents of <head> before plugin content gets added.
$context              = Timber::get_context();
$context['page_head'] = $theme->render('partials/page_head.html.twig', $context);
 
$post            = Timber::query_post();
$context['post'] = $post;
 
Timber::render(['page-' . $post->post_name . '.html.twig', 'page.html.twig'], $context);
 
            }
 
            break;
        }
    }
 
    if ( ! $template ) {
        $template = get_index_template();
    }
 
    /**
     * Filters the path of the current template before including it.
     *
     * @since 3.0.0
     *
     * @param string $template The path of the template to include.
     */
    $template = apply_filters( 'template_include', $template );
    if ( $template ) {
        include $template;
    } elseif ( current_user_can( 'switch_themes' ) ) {
        $theme = wp_get_theme();
        if ( $theme->errors() ) {
            wp_die( $theme->errors() );
        }
    }
    return;
}
 
<?php
/**
 * Loads the WordPress environment and template.
 *
 * @package WordPress
 */
 
if ( ! isset( $wp_did_header ) ) {
 
    $wp_did_header = true;
 
    // Load the WordPress library.
    require_once __DIR__ . '/wp-load.php';
 
    // Set up the WordPress query.
    wp();
 
    // Load the theme template.
    require_once ABSPATH . WPINC . '/template-loader.php';
 
}
 
<?php
/**
 * Front to the WordPress application. This file doesn't do anything, but loads
 * wp-blog-header.php which does and tells WordPress to load the theme.
 *
 * @package WordPress
 */
 
/**
 * Tells WordPress to load the WordPress theme and output it.
 *
 * @var bool
 */
define( 'WP_USE_THEMES', true );
 
/** Loads the WordPress Environment and Template */
require __DIR__ . '/wp-blog-header.php';
 

Environment & details:

Key Value
q /fr/presse/
empty
empty
empty
empty
Key Value
SERVER_SOFTWARE nginx/1.14.0
REQUEST_URI /fr/presse/
PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
TEMP /var/www/clients/client15/web36/tmp
TMPDIR /var/www/clients/client15/web36/tmp
TMP /var/www/clients/client15/web36/tmp
HOSTNAME
USER web36
HOME /var/www/clients/client15/web36
HTTP_CONNECTION Keep-Alive
HTTP_HOST www.valdargan.com
HTTP_ACCEPT_ENCODING br,gzip
HTTP_IF_MODIFIED_SINCE Wed, 05 Aug 2020 01:12:57 GMT
HTTP_ACCEPT_LANGUAGE en-US,en;q=0.5
HTTP_ACCEPT text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_USER_AGENT CCBot/2.0 (https://commoncrawl.org/faq/)
SCRIPT_FILENAME /var/www/valdargan.com/web/index.php
REDIRECT_STATUS 200
SERVER_NAME valdargan.com
SERVER_PORT 443
SERVER_ADDR 92.243.9.28
REMOTE_PORT 34416
REMOTE_ADDR 34.200.236.68
GATEWAY_INTERFACE CGI/1.1
HTTPS on
REQUEST_SCHEME https
SERVER_PROTOCOL HTTP/1.1
DOCUMENT_ROOT /var/www/valdargan.com/web
DOCUMENT_URI /index.php
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING q=/fr/presse/&
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1601360537.7274
REQUEST_TIME 1601360537
empty
0. Whoops\Handler\PrettyPageHandler