Twig \ Error \ RuntimeError
An exception has been thrown during the rendering of a template ("Use of undefined constant photos - assumed 'photos' (this will throw an Error in a future version of PHP)").
Previous exceptions
  • Use of undefined constant photos - assumed 'photos' (this will throw an Error in a future version of PHP) (2)
Twig\Error\RuntimeError thrown with message "An exception has been thrown during the rendering of a template ("Use of undefined constant photos - assumed 'photos' (this will throw an Error in a future version of PHP)")." Stacktrace: #44 Twig\Error\RuntimeError in /var/www/clients/client15/web36/web/wp-content/themes/g5_helium/views/partials/content-page.html.twig:45 #43 Whoops\Exception\ErrorException in /var/www/clients/client15/web36/web/wp-content/themes/valdargan/functions.php:94 #42 Gantry\Component\Whoops\SystemFacade:handleError in /var/www/clients/client15/web36/web/wp-content/themes/valdargan/functions.php:94 #41 vda_photos_display in /var/www/clients/client15/web36/web/wp-content/themes/valdargan/functions.php:83 #40 vda_photos in /var/www/clients/client15/web36/web/wp-includes/shortcodes.php:343 #39 do_shortcode_tag in [internal]:0 #38 preg_replace_callback in /var/www/clients/client15/web36/web/wp-includes/shortcodes.php:218 #37 do_shortcode in /var/www/clients/client15/web36/web/wp-content/plugins/so-widgets-bundle/widgets/editor/editor.php:105 #36 SiteOrigin_Widget_Editor_Widget:get_template_variables in /var/www/clients/client15/web36/web/wp-content/plugins/so-widgets-bundle/base/siteorigin-widget.class.php:183 #35 SiteOrigin_Widget:widget in /var/www/clients/client15/web36/web/wp-content/plugins/siteorigin-panels/inc/renderer.php:550 #34 SiteOrigin_Panels_Renderer:the_widget in /var/www/clients/client15/web36/web/wp-content/plugins/siteorigin-panels/inc/renderer.php:870 #33 SiteOrigin_Panels_Renderer:render_widget in /var/www/clients/client15/web36/web/wp-content/plugins/siteorigin-panels/inc/renderer.php:830 #32 SiteOrigin_Panels_Renderer:render_cell in /var/www/clients/client15/web36/web/wp-content/plugins/siteorigin-panels/inc/renderer.php:756 #31 SiteOrigin_Panels_Renderer:render_row in /var/www/clients/client15/web36/web/wp-content/plugins/siteorigin-panels/inc/renderer.php:336 #30 SiteOrigin_Panels_Renderer:render in /var/www/clients/client15/web36/web/wp-content/plugins/siteorigin-panels/siteorigin-panels.php:322 #29 SiteOrigin_Panels:generate_post_content in /var/www/clients/client15/web36/web/wp-includes/class-wp-hook.php:287 #28 WP_Hook:apply_filters in /var/www/clients/client15/web36/web/wp-includes/plugin.php:206 #27 apply_filters in /var/www/clients/client15/web36/web/wp-content/plugins/gantry5/src/vendor/timber/timber/lib/Post.php:1227 #26 Timber\Post:content in /var/www/clients/client15/web36/web/wp-content/plugins/gantry5/src/vendor/twig/twig/src/Template.php:702 #25 Twig\Template:getAttribute in /var/www/clients/client15/web36/web/wp-content/cache/gantry5/valdargan/twig/35/35207dd6855a42c1dc5699781c829db5e1f0052b8910ef655f1029bc8e1a764f.php:148 #24 __TwigTemplate_2a1ecfb4aec31888dedbbd0a36a7ac9abb04af9295321fe74985e978c8526f8e:block_content in /var/www/clients/client15/web36/web/wp-content/plugins/gantry5/src/vendor/twig/twig/src/Template.php:216 #23 Twig\Template:displayBlock in /var/www/clients/client15/web36/web/wp-content/cache/gantry5/valdargan/twig/35/35207dd6855a42c1dc5699781c829db5e1f0052b8910ef655f1029bc8e1a764f.php:41 #22 __TwigTemplate_2a1ecfb4aec31888dedbbd0a36a7ac9abb04af9295321fe74985e978c8526f8e: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/b4/b4f33fb0836f611f5e1cbcad512a049dcbcd958a2ea781f8f1a0bbc31748ff69.php:54 #19 __TwigTemplate_1063cb1d050b2774122e9e8f51352c74d177d6e71d5dd88963e970d457af2c1c:block_content 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:55 #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 (45)
44
Twig\Error\RuntimeError
/var/www/clients/client15/web36/web/wp-content/themes/g5_helium/views/partials/content-page.html.twig45
43
Whoops\Exception\ErrorException
/var/www/clients/client15/web36/web/wp-content/themes/valdargan/functions.php94
42
Gantry\Component\Whoops\SystemFacade handleError
/var/www/clients/client15/web36/web/wp-content/themes/valdargan/functions.php94
41
vda_photos_display
/var/www/clients/client15/web36/web/wp-content/themes/valdargan/functions.php83
40
vda_photos
/var/www/clients/client15/web36/web/wp-includes/shortcodes.php343
39
do_shortcode_tag
[internal]0
38
preg_replace_callback
/var/www/clients/client15/web36/web/wp-includes/shortcodes.php218
37
do_shortcode
/var/www/clients/client15/web36/web/wp-content/plugins/so-widgets-bundle/widgets/editor/editor.php105
36
SiteOrigin_Widget_Editor_Widget get_template_variables
/var/www/clients/client15/web36/web/wp-content/plugins/so-widgets-bundle/base/siteorigin-widget.class.php183
35
SiteOrigin_Widget widget
/var/www/clients/client15/web36/web/wp-content/plugins/siteorigin-panels/inc/renderer.php550
34
SiteOrigin_Panels_Renderer the_widget
/var/www/clients/client15/web36/web/wp-content/plugins/siteorigin-panels/inc/renderer.php870
33
SiteOrigin_Panels_Renderer render_widget
/var/www/clients/client15/web36/web/wp-content/plugins/siteorigin-panels/inc/renderer.php830
32
SiteOrigin_Panels_Renderer render_cell
/var/www/clients/client15/web36/web/wp-content/plugins/siteorigin-panels/inc/renderer.php756
31
SiteOrigin_Panels_Renderer render_row
/var/www/clients/client15/web36/web/wp-content/plugins/siteorigin-panels/inc/renderer.php336
30
SiteOrigin_Panels_Renderer render
/var/www/clients/client15/web36/web/wp-content/plugins/siteorigin-panels/siteorigin-panels.php322
29
SiteOrigin_Panels generate_post_content
/var/www/clients/client15/web36/web/wp-includes/class-wp-hook.php287
28
WP_Hook apply_filters
/var/www/clients/client15/web36/web/wp-includes/plugin.php206
27
apply_filters
/vendor/timber/timber/lib/Post.php1227
26
Timber\Post content
/vendor/twig/twig/src/Template.php702
25
Twig\Template getAttribute
/var/www/clients/client15/web36/web/wp-content/cache/gantry5/valdargan/twig/35/35207dd6855a42c1dc5699781c829db5e1f0052b8910ef655f1029bc8e1a764f.php148
24
__TwigTemplate_2a1ecfb4aec31888dedbbd0a36a7ac9abb04af9295321fe74985e978c8526f8e block_content
/vendor/twig/twig/src/Template.php216
23
Twig\Template displayBlock
/var/www/clients/client15/web36/web/wp-content/cache/gantry5/valdargan/twig/35/35207dd6855a42c1dc5699781c829db5e1f0052b8910ef655f1029bc8e1a764f.php41
22
__TwigTemplate_2a1ecfb4aec31888dedbbd0a36a7ac9abb04af9295321fe74985e978c8526f8e 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/b4/b4f33fb0836f611f5e1cbcad512a049dcbcd958a2ea781f8f1a0bbc31748ff69.php54
19
__TwigTemplate_1063cb1d050b2774122e9e8f51352c74d177d6e71d5dd88963e970d457af2c1c block_content
/vendor/twig/twig/src/Template.php216
18
Twig\Template displayBlock
/var/www/clients/client15/web36/web/wp-content/cache/gantry5/valdargan/twig/35/3597c5f6daa68a93f8eb2aaa92605a5ce92ea200e1aba9f79e49f7511cec4733.php55
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
        </section>
        {# End Entry Header #}
 
        {# Check if page is password protected #}
        {% if not function( 'post_password_required', post.ID ) %}
 
            {# Begin Entry Content #}
            <section class="entry-content">
 
                {# Begin Featured Image #}
                {% if gantry.config.get('content.' ~ scope ~ '.featured-image.enabled', '1') and post.thumbnail.src %}
                    {% set position = (gantry.config.get('content.' ~ scope ~ '.featured-image.position', 'none') == 'none') ? '' : 'float-' ~ gantry.config.get('content.' ~ scope ~ '.featured-image.position', 'none') %}
                    <a href="{{ post.link }}" class="post-thumbnail" aria-hidden="true">
                        <img src="{{ post.thumbnail.src|resize(gantry.config.get('content.' ~ scope ~ '.featured-image.width', '1200'), gantry.config.get('content.' ~ scope ~ '.featured-image.height', '350')) }}" class="featured-image tease-featured-image {{ position }}" alt="{{ post.title }}" />
                    </a>
                {% endif %}
                {# End Featured Image #}
 
                {# Begin Page Content #}
                {{ post.content|raw }}
 
                {{ function('wp_link_pages', {'before': '<div class="page-links" itemprop="pagination">', 'after': '</div>', 'link_before': '<span class="page-number page-numbers">', 'link_after': '</span>', 'echo': 0}) }}
                {# End Page Content #}
 
                {# Begin Edit Link #}
                {{ function('edit_post_link', __('Edit', 'g5_helium'), '<span class="edit-link">', '</span>') }}
                {# End Edit Link #}
 
            </section>
            {# End Entry Content #}
 
        {% else %}
 
            {# Begin Password Protected Form #}
            <div class="password-form">
 
                {# Include the password form #}
                {% include 'partials/password-form.html.twig' %}
 
            </div>
        wp_enqueue_style('valdargan.css',  '/wp-content/themes/valdargan/custom/css/valdargan.css', array(), null, 'all');
    }
    add_action('wp_enqueue_scripts', 'vda_custom_wp_style',99999999999 );     
}

add_shortcode('vda_photos','vda_photos');

function vda_photos() {
    vda_photos_display(0);
}
function vda_photos_display($start=0) {
    $photos=get_posts([
      'post_type' => 'photo',
      'post_status' => 'publish',
      'numberposts' => -1
    ]); 
    $toutes_photos=$photos;   
    $terms=array();
    $max=12;
    if(count(photos)>0) {
        foreach($photos as $photo) {
            $categ=get_the_terms($photo->ID,'categorie_photo')[0];
            if(!in_array($categ,$terms)) {
                $terms[]=$categ;
            }
        }
        if($start==0) {
            if(count($terms)>0) {
                wp_enqueue_script('isotope.pkgd.min.js','/wp-content/themes/valdargan/custom/js/isotope.pkgd.min.js', 99999998,false,true);                
                wp_enqueue_script('jquery.magnific-popup.min.js','/wp-content/themes/valdargan/custom/js/jquery.magnific-popup.min.js', 99999998,false,true);            wp_enqueue_style('magnific-popup.css',  '/wp-content/themes/valdargan/custom/css/magnific-popup.css', array(), null, 'all');
            ?>   
            <ul id="vda_gallery_filters">
                <li class="selected"><a><href="#" data_filter="*"><?php echo pll__('Tout'); ?></a></li>
                <?php foreach($terms as $term) { ?>        
                <li><a href="#" data_filter=".<?php echo $term->slug; ?>"><?php echo $term->name; ?></a></li>
                <?php } ?>
            </ul>
            <div id="vda_gallery_container">
            <?php
            }
Exception message: Use of undefined constant photos - assumed 'photos' (this will throw an Error in a future version of PHP)
        wp_enqueue_style('valdargan.css',  '/wp-content/themes/valdargan/custom/css/valdargan.css', array(), null, 'all');
    }
    add_action('wp_enqueue_scripts', 'vda_custom_wp_style',99999999999 );     
}

add_shortcode('vda_photos','vda_photos');

function vda_photos() {
    vda_photos_display(0);
}
function vda_photos_display($start=0) {
    $photos=get_posts([
      'post_type' => 'photo',
      'post_status' => 'publish',
      'numberposts' => -1
    ]); 
    $toutes_photos=$photos;   
    $terms=array();
    $max=12;
    if(count(photos)>0) {
        foreach($photos as $photo) {
            $categ=get_the_terms($photo->ID,'categorie_photo')[0];
            if(!in_array($categ,$terms)) {
                $terms[]=$categ;
            }
        }
        if($start==0) {
            if(count($terms)>0) {
                wp_enqueue_script('isotope.pkgd.min.js','/wp-content/themes/valdargan/custom/js/isotope.pkgd.min.js', 99999998,false,true);                
                wp_enqueue_script('jquery.magnific-popup.min.js','/wp-content/themes/valdargan/custom/js/jquery.magnific-popup.min.js', 99999998,false,true);            wp_enqueue_style('magnific-popup.css',  '/wp-content/themes/valdargan/custom/css/magnific-popup.css', array(), null, 'all');
            ?>   
            <ul id="vda_gallery_filters">
                <li class="selected"><a><href="#" data_filter="*"><?php echo pll__('Tout'); ?></a></li>
                <?php foreach($terms as $term) { ?>        
                <li><a href="#" data_filter=".<?php echo $term->slug; ?>"><?php echo $term->name; ?></a></li>
                <?php } ?>
            </ul>
            <div id="vda_gallery_container">
            <?php
            }
        $dir = plugin_dir_path(__FILE__);
        wp_enqueue_style('theme-override',  '/wp-content/themes/valdargan/custom/css/valdargan.admin.css', array(), null, 'all');
    }
    add_action('admin_enqueue_scripts', 'vda_custom_wp_admin_style', 9999999999 );
}
else {
    add_filter('show_admin_bar', '__return_false');   
    wp_enqueue_script('valdargan.js','/wp-content/themes/valdargan/custom/js/valdargan.js', 99999999,false,true);      
    function vda_custom_wp_style() {
        $dir = plugin_dir_path(__FILE__);
        //wp_enqueue_style('fontawesome',  'https://use.fontawesome.com/releases/v5.5.0/css/all.css', array(), null, 'all');
        wp_enqueue_style('valdargan.css',  '/wp-content/themes/valdargan/custom/css/valdargan.css', array(), null, 'all');
    }
    add_action('wp_enqueue_scripts', 'vda_custom_wp_style',99999999999 );     
}

add_shortcode('vda_photos','vda_photos');

function vda_photos() {
    vda_photos_display(0);
}
function vda_photos_display($start=0) {
    $photos=get_posts([
      'post_type' => 'photo',
      'post_status' => 'publish',
      'numberposts' => -1
    ]); 
    $toutes_photos=$photos;   
    $terms=array();
    $max=12;
    if(count(photos)>0) {
        foreach($photos as $photo) {
            $categ=get_the_terms($photo->ID,'categorie_photo')[0];
            if(!in_array($categ,$terms)) {
                $terms[]=$categ;
            }
        }
        if($start==0) {
            if(count($terms)>0) {
                wp_enqueue_script('isotope.pkgd.min.js','/wp-content/themes/valdargan/custom/js/isotope.pkgd.min.js', 99999998,false,true);                
     * 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.
            }
 
            // As in the Text Widget, we need to prevent plugins and themes from running `do_shortcode` in the `widget_text`
            // filter to avoid running it twice and to prevent `wpautop` from interfering with shortcodes' output.
            $widget_text_do_shortcode_priority = has_filter( 'widget_text', 'do_shortcode' );
            if ( $widget_text_do_shortcode_priority !== false ) {
                remove_filter( 'widget_text', 'do_shortcode', $widget_text_do_shortcode_priority );
            }
 
            $instance['text'] = apply_filters( 'widget_text', $instance['text'] );
 
            if ( $widget_text_do_shortcode_priority !== false ) {
                add_filter( 'widget_text', 'do_shortcode', $widget_text_do_shortcode_priority );
            }
 
            if( $instance['autop'] ) {
                $instance['text'] = wpautop( $instance['text'] );
            }
 
            $instance['text'] = do_shortcode( shortcode_unautop( $instance['text'] ) );
 
            $instance['text'] = $this->process_more_quicktag( $instance['text'] );
        }
 
 
        return array(
            'text' => $instance['text'],
        );
    }
 
    private function process_more_quicktag( $content ) {
        $post = get_post();
        if ( ! empty( $post ) ) {
            $panels_content = get_post_meta( $post->ID, 'panels_data', true );
        }
        // We only want to do this processing if on archive pages for posts with non-PB layouts.
        if ( ! is_singular() && empty( $panels_content ) && ! $this->is_block_editor_page() && empty( $GLOBALS['SO_WIDGETS_BUNDLE_PREVIEW_RENDER'] ) ) {
            if ( preg_match( '/<!--more(.*?)?-->/', $content, $matches ) ) {
                $content = explode( $matches[0], $content, 2 );
                $content = $content[0];
        $instance = $this->modify_instance( $instance );
 
        // Filter the instance
        $instance = apply_filters( 'siteorigin_widgets_instance', $instance, $this );
        $instance = apply_filters( 'siteorigin_widgets_instance_' . $this->id_base, $instance, $this );
 
        $args = wp_parse_args( $args, array(
            'before_widget' => '',
            'after_widget' => '',
            'before_title' => '',
            'after_title' => '',
        ) );
 
        // Add any missing default values to the instance
        $instance = $this->add_defaults( $form_options, $instance );
 
        $css_name = $this->generate_and_enqueue_instance_styles( $instance );
        $this->enqueue_frontend_scripts( $instance );
 
        $template_vars = $this->get_template_variables($instance, $args);
        $template_vars = apply_filters( 'siteorigin_widgets_template_variables_' . $this->id_base, $template_vars, $instance, $args, $this );
 
        // Storage hash allows templates to get access to
        $template_vars[ 'storage_hash' ] = '';
        if( !empty($this->widget_options['instance_storage']) ) {
            $stored_instance = $this->modify_stored_instance($instance);
            // We probably don't want panels_info
            unset( $stored_instance['panels_info'] );
 
            $template_vars[ 'storage_hash' ] = substr( md5( serialize( $stored_instance ) ), 0, 8 );
            if( !empty( $stored_instance ) && !$this->is_preview( $instance ) ) {
                // Store this if we have a non empty instance and are not previewing
                set_transient('sow_inst[' . $this->id_base . '][' . $template_vars['storage_hash'] . ']', $stored_instance, 7*86400);
            }
        }
 
        if( ! method_exists( $this, 'get_html_content' ) ) {
            $template_file = siteorigin_widget_get_plugin_dir_path( $this->id_base ) . $this->get_template_dir( $instance ) . '/' . $this->get_template_name( $instance ) . '.php';
            $template_file = apply_filters('siteorigin_widgets_template_file_' . $this->id_base, $template_file, $instance, $this );
            $template_file = realpath($template_file);
        );
 
        // Let other themes and plugins change the arguments that go to the widget class.
        $args = apply_filters( 'siteorigin_panels_widget_args', $args );
 
        // If there is a style wrapper, add it.
        if ( ! empty( $style_wrapper ) ) {
            $args['before_widget'] = $args['before_widget'] . $style_wrapper;
            $args['after_widget'] = '</div>' . $args['after_widget'];
        }
 
        // This gives other plugins the chance to take over rendering of widgets
        $widget_html = apply_filters( 'siteorigin_panels_the_widget_html', '', $the_widget, $args, $instance );
 
        if ( ! empty( $widget_html ) ) {
            echo $args['before_widget'];
            echo $widget_html;
            echo $args['after_widget'];
        } else if ( ! empty( $the_widget ) && is_a( $the_widget, 'WP_Widget' ) ) {
            $the_widget->widget( $args, $instance );
        } else {
            // This gives themes a chance to display some sort of placeholder for missing widgets
            echo apply_filters( 'siteorigin_panels_missing_widget', $args['before_widget'] . $args['after_widget'], $widget_class, $args, $instance );
        }
    }
 
    /**
     * Print inline CSS in the header and footer.
     */
    function print_inline_css() {
        if ( ! empty( $this->inline_css ) ) {
            $the_css = '';
            foreach ( $this->inline_css as $post_id => $css ) {
                if ( empty( $css ) ) {
                    continue;
                }
                $the_css .= '/* Layout ' . esc_attr( $post_id ) . ' */ ';
                $the_css .= $css;
            }
 
     *
     */
    private function render_widget( $post_id, $ri, $ci, $wi, & $widget, $is_last ) {
 
        $widget_style_wrapper = $this->start_style_wrapper(
            'widget',
            ! empty( $widget['panels_info']['style'] ) ? $widget['panels_info']['style'] : array(),
            $post_id . '-' . $ri . '-' . $ci . '-' . $wi
        );
 
        $this->the_widget(
            $widget['panels_info'],
            $widget,
            $ri,
            $ci,
            $wi,
            $wi == 0,
            $is_last,
            $post_id,
            $widget_style_wrapper
        );
 
    }
 
    public function front_css_url() {
        return siteorigin_panels_url( 'css/front-flex' . SITEORIGIN_PANELS_CSS_SUFFIX . '.css' );
    }
}
 
 
        echo apply_filters( 'siteorigin_panels_before_cell', '', $cell, $cell_attributes );
 
        $this->render_element( 'div', $cell_attributes );
 
        $grid = $panels_data['grids'][ $ri ];
 
        if ( empty( $cell['style']['class'] ) && ! empty( $grid['style']['cell_class'] ) ) {
            $cell['style']['class'] = $grid['style']['cell_class'];
        }
 
        $cell_style = ! empty( $cell['style'] ) ? $cell['style'] : array();
        $cell_style_wrapper = $this->start_style_wrapper( 'cell', $cell_style, $post_id . '-' . $ri . '-' . $ci );
        if ( ! empty( $cell_style_wrapper ) ) {
            echo $cell_style_wrapper;
        }
 
        foreach ( $cell['widgets'] as $wi => & $widget ) {
            $is_last = ( $wi == count( $cell['widgets'] ) - 1 );
            $this->render_widget( $post_id, $ri, $ci, $wi, $widget, $is_last );
        }
 
        if ( ! empty( $cell_style_wrapper ) ) {
            echo '</div>';
        }
        echo '</div>';
 
        echo apply_filters( 'siteorigin_panels_after_cell', '', $cell, $cell_attributes );
    }
 
    /**
     *
     * Gets the style wrapper for this widget and passes it through to `the_widget` along with other required parameters.
     *
     * @param string $post_id The ID of the post containing this layout.
     * @param int $ri The index of this widget's ancestor row.
     * @param int $ci The index of this widget's parent cell.
     * @param int $wi The index of this widget.
     * @param array $widget The model containing this widget's data.
     * @param bool $is_last Whether this is the last widget in the parent cell.
            'id'    => 'pg-' . $post_id . '-' . $ri,
            'class' => implode( ' ', $row_classes ),
        ), $row );
 
        // This allows other themes and plugins to add html before the row
        echo apply_filters( 'siteorigin_panels_before_row', '', $row, $row_attributes );
 
        $this->render_element( 'div', $row_attributes );
 
        if ( ! empty( $row_style_wrapper ) ) {
            echo $row_style_wrapper;
        }
 
        if( method_exists( $this, 'modify_row_cells' ) ) {
            // This gives other renderers a chance to change the cell order
            $row['cells'] = $cells = $this->modify_row_cells( $row['cells'], $row );
        }
 
        foreach ( $row['cells'] as $ci => & $cell ) {
            $this->render_cell( $post_id, $ri, $ci, $cell, $row['cells'], $panels_data );
        }
 
        // Close the style wrapper
        if ( ! empty( $row_style_wrapper ) ) {
            echo '</div>';
        }
 
        echo '</div>';
 
        // This allows other themes and plugins to add html after the row
        echo apply_filters( 'siteorigin_panels_after_row', '', $row, $row_attributes );
 
    }
 
    /**
     *
     * Render everything for the given cell, including:
     *  - filters before and after cell,
     *  - cell element wrapper with attributes,
     *  - style wrapper,
        $layout_data = apply_filters( 'siteorigin_panels_layout_data', $layout_data, $post_id );
 
        ob_start();
 
        // Add the panel layout wrapper
        $layout_classes = apply_filters( 'siteorigin_panels_layout_classes', array( 'panel-layout' ), $post_id, $panels_data );
        if ( is_rtl() ) {
            $layout_classes[] = 'panel-is-rtl';
        }
        $layout_attributes = apply_filters( 'siteorigin_panels_layout_attributes', array(
            'id'    => 'pl-' . $post_id,
            'class' => implode( ' ', $layout_classes ),
        ), $post_id, $panels_data );
 
        $this->render_element( 'div', $layout_attributes );
 
        echo apply_filters( 'siteorigin_panels_before_content', '', $panels_data, $post_id );
 
        foreach ( $layout_data as $ri => & $row ) {
            $this->render_row( $post_id, $ri, $row, $panels_data );
        }
 
        echo apply_filters( 'siteorigin_panels_after_content', '', $panels_data, $post_id );
 
        echo '</div>';
 
        do_action( 'siteorigin_panels_after_render', $panels_data, $post_id );
 
        $html = ob_get_clean();
 
        if ( $enqueue_css && ! isset( $this->inline_css[ $post_id ] ) ) {
            wp_enqueue_style( 'siteorigin-panels-front' );
            $this->add_inline_css( $post_id, $this->generate_css( $post_id, $panels_data, $layout_data ) );
        }
 
        // Reset the current post
        $siteorigin_panels_current_post = $old_current_post;
        
        $rendered_layout = apply_filters( 'siteorigin_panels_render', $html, $post_id, ! empty( $post ) ? $post : null );
        
     * @filter the_content
     */
    public function generate_post_content( $content ) {
        global $post, $preview;
        if ( empty( $post ) && ! in_the_loop() ) {
            return $content;
        }
 
        if ( ! apply_filters( 'siteorigin_panels_filter_content_enabled', true ) ) {
            return $content;
        }
        
        $post_id = $this->get_post_id();
        
        // Check if this post has panels_data
        if ( get_post_meta( $post_id, 'panels_data', true ) ) {
            $panel_content = SiteOrigin_Panels::renderer()->render(
                $post_id,
                // Add CSS if this is not the main single post, this is handled by add_single_css
                $preview || $post_id !== get_queried_object_id()
            );
 
            if ( ! empty( $panel_content ) ) {
                $content = $panel_content;
 
                if ( ! is_singular() ) {
                    // This is an archive page, so try strip out anything after the more text
 
                    if ( preg_match( '/<!--more(.*?)?-->/', $content, $matches ) ) {
                        $content = explode( $matches[0], $content, 2 );
                        $content = $content[0];
                        $content = force_balance_tags( $content );
                        if ( ! empty( $matches[1] ) ) {
                            $more_link_text = strip_tags( wp_kses_no_null( trim( $matches[1] ) ) );
                        } else {
                            $more_link_text = __( 'Read More', 'siteorigin-panels' );
                        }
 
                        $more_link = apply_filters( 'the_content_more_link', ' <a href="' . get_permalink() . "#more-{$post->ID}\" class=\"more-link\">$more_link_text</a>", $more_link_text );
                        $content .= '<p>' . $more_link . '</p>';
 
        $nesting_level = $this->nesting_level++;
 
        $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.
    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.
            return $rd;
        }
        if ( $form = $this->maybe_show_password_form() ) {
            return $form;
        }
        if ( $len == -1 && $page == 0 && $this->___content ) {
            return $this->___content;
        }
        $content = $this->post_content;
        if ( $len > 0 ) {
            $content = wp_trim_words($content, $len);
        }
        if ( $page ) {
            $contents = explode('<!--nextpage-->', $content);
            $page--;
            if ( count($contents) > $page ) {
                $content = $contents[$page];
            }
        }
        $content = apply_filters('the_content', ($content));
        if ( $len == -1 && $page == 0 ) {
            $this->___content = $content;
        }
        return $content;
    }
 
    /**
     * @return string
     */
    public function paged_content() {
        global $page;
        return $this->content($page, -1);
    }
 
    /**
     * Get the date to use in your template!
     * @api
     * @example
     * ```twig
     * Published on {{ post.date }} // Uses WP's formatting set in Admin
            if ($ignoreStrictCheck || !$this->env->isStrictVariables()) {
                return;
            }
 
            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());
                echo "\" class=\"post-thumbnail\" aria-hidden=\"true\">
                        <img src=\"";
                // line 39
                echo Timber\ImageHelper::resize($this->getAttribute($this->getAttribute(($context["post"] ?? null), "thumbnail", []), "src", []), $this->getAttribute($this->getAttribute(($context["gantry"] ?? null), "config", []), "get", [0 => (("content." . ($context["scope"] ?? null)) . ".featured-image.width"), 1 => "1200"], "method"), $this->getAttribute($this->getAttribute(($context["gantry"] ?? null), "config", []), "get", [0 => (("content." . ($context["scope"] ?? null)) . ".featured-image.height"), 1 => "350"], "method"));
                echo "\" class=\"featured-image tease-featured-image ";
                echo ($context["position"] ?? null);
                echo "\" alt=\"";
                echo $this->getAttribute(($context["post"] ?? null), "title", []);
                echo "\" />
                    </a>
                ";
            }
            // line 42
            echo "                ";
            // line 43
            echo "
                ";
            // line 45
            echo "                ";
            echo $this->getAttribute(($context["post"] ?? null), "content", []);
            echo "
 
                ";
            // line 47
            echo call_user_func_array($this->env->getFunction('function')->getCallable(), ["wp_link_pages", ["before" => "<div class=\"page-links\" itemprop=\"pagination\">", "after" => "</div>", "link_before" => "<span class=\"page-number page-numbers\">", "link_after" => "</span>", "echo" => 0]]);
            echo "
                ";
            // line 49
            echo "
                ";
            // line 51
            echo "                ";
            echo call_user_func_array($this->env->getFunction('function')->getCallable(), ["edit_post_link", __("Edit", "g5_helium"), "<span class=\"edit-link\">", "</span>"]);
            echo "
                ";
            // line 53
            echo "
            </section>
            ";
            // line 56
 
        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);
 
        $this->blocks = [
            'content' => [$this, 'block_content'],
        ];
    }
 
    protected function doDisplay(array $context, array $blocks = [])
    {
        // line 1
        echo "<article class=\"post-type-";
        echo $this->getAttribute(($context["post"] ?? null), "post_type", []);
        echo " ";
        echo $this->getAttribute(($context["post"] ?? null), "class", []);
        echo "\" id=\"post-";
        echo $this->getAttribute(($context["post"] ?? null), "ID", []);
        echo "\">
 
    ";
        // line 3
        $this->displayBlock('content', $context, $blocks);
        // line 71
        echo "
</article>
";
    }
 
    // line 3
    public function block_content($context, array $blocks = [])
    {
        // line 4
        echo "
        ";
        // line 6
        echo "        <section class=\"entry-header\">
 
            ";
        // line 8
        if ($this->getAttribute($this->getAttribute(($context["gantry"] ?? null), "config", []), "get", [0 => (("content." . ($context["scope"] ?? null)) . ".title.enabled"), 1 => "1"], "method")) {
            // line 9
            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) {
        $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>
 
";
    }
 
    public function getTemplateName()
    {
        return "page.html.twig";
    }
 
    public function isTraitable()
    {
        return false;
    }
 
    public function getDebugInfo()
 
        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);
    }
 
    protected function doDisplay(array $context, array $blocks = [])
    {
        // line 1
        $this->getAttribute($this->getAttribute(($context["gantry"] ?? null), "debugger", []), "startTimer", [0 => "render", 1 => "Rendering page"], "method");
        // line 2
        $this->getAttribute($this->getAttribute(($context["gantry"] ?? null), "theme", []), "setLayout", [], "method");
        // line 3
        $this->getAttribute($this->getAttribute(($context["gantry"] ?? null), "theme", []), "loadAtoms", [], "method");
        // line 4
        $context["segments"] = $this->getAttribute($this->getAttribute(($context["gantry"] ?? null), "theme", []), "segments", [], "method");
        // line 6
        ob_start(function () { return ''; });
        // line 7
        echo "    ";
        if ($this->getAttribute($this->getAttribute(($context["gantry"] ?? null), "theme", []), "hasContent", [], "method")) {
            // line 8
            echo "        ";
            $this->displayBlock('content', $context, $blocks);
            // line 10
            echo "    ";
        }
        $context["content"] = ('' === $tmp = ob_get_clean()) ? '' : new Markup($tmp, $this->env->getCharset());
        // line 13
        $context["offcanvas"] = null;
        // line 14
        $context['_parent'] = $context;
        $context['_seq'] = twig_ensure_traversable(($context["segments"] ?? null));
        foreach ($context['_seq'] as $context["_key"] => $context["segment"]) {
            if (($this->getAttribute($context["segment"], "type", []) == "offcanvas")) {
                // line 15
                $context["offcanvas"] = $context["segment"];
            }
        }
        $_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 ''; });
            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 /en/photo-library/
empty
empty
empty
empty
Key Value
SERVER_SOFTWARE nginx/1.14.0
REQUEST_URI /en/photo-library/
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 Sun, 31 May 2020 09:08:13 UTC
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 34440
REMOTE_ADDR 35.168.112.145
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=/en/photo-library/&
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1594496178.8185
REQUEST_TIME 1594496178
empty
0. Whoops\Handler\PrettyPageHandler