Twig \ Error \ RuntimeError
An exception has been thrown during the rendering of a template ("Undefined array key 0").
Previous exceptions
  • Undefined array key 0 (2)
Twig\Error\RuntimeError thrown with message "An exception has been thrown during the rendering of a template ("Undefined array key 0")." Stacktrace: #30 Twig\Error\RuntimeError in /usr/share/nginx/html/portal-cetapp/wp-content/themes/g5_helium/custom/views/partials/content-single.html.twig:22 #29 Whoops\Exception\ErrorException in /usr/share/nginx/html/portal-cetapp/wp-content/plugins/gantry5/vendor/timber/timber/lib/ImageHelper.php:379 #28 Gantry\Component\Whoops\SystemFacade:handleError in /usr/share/nginx/html/portal-cetapp/wp-content/plugins/gantry5/vendor/timber/timber/lib/ImageHelper.php:379 #27 Timber\ImageHelper:sideload_image in /usr/share/nginx/html/portal-cetapp/wp-content/plugins/gantry5/vendor/timber/timber/lib/ImageHelper.php:588 #26 Timber\ImageHelper:_operate in /usr/share/nginx/html/portal-cetapp/wp-content/plugins/gantry5/vendor/timber/timber/lib/ImageHelper.php:72 #25 Timber\ImageHelper:resize in /usr/share/nginx/html/portal-cetapp/wp-content/cache/gantry5/g5_helium/twig/6c/6c388b0d4f87d5b256c734bb769bf95bb998f084650e083fde316c7fac77cbb0.php:104 #24 __TwigTemplate_308b6658394047e02c330373a5ae25e7743b0e2e2094dc5893949f7de9696f21:block_content in /usr/share/nginx/html/portal-cetapp/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:214 #23 Twig\Template:displayBlock in /usr/share/nginx/html/portal-cetapp/wp-content/cache/gantry5/g5_helium/twig/6c/6c388b0d4f87d5b256c734bb769bf95bb998f084650e083fde316c7fac77cbb0.php:41 #22 __TwigTemplate_308b6658394047e02c330373a5ae25e7743b0e2e2094dc5893949f7de9696f21:doDisplay in /usr/share/nginx/html/portal-cetapp/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:453 #21 Twig\Template:displayWithErrorHandling in /usr/share/nginx/html/portal-cetapp/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:420 #20 Twig\Template:display in /usr/share/nginx/html/portal-cetapp/wp-content/cache/gantry5/g5_helium/twig/e4/e4903eb3129743d2e6b7bfea0d03de0945413a4d61f4cedb3c545823d10b57c2.php:54 #19 __TwigTemplate_3bbd3b1279026934625e86c61a4ed27151de5ed003e2ac3d133fc000394174e3:block_content in /usr/share/nginx/html/portal-cetapp/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:214 #18 Twig\Template:displayBlock in /usr/share/nginx/html/portal-cetapp/wp-content/cache/gantry5/g5_helium/twig/97/975e4c4956e8cd24da58139a06b41318c81396755a97404b9274d439b11c1cdb.php:55 #17 __TwigTemplate_40d8c2f730ad5a5de20c6a58a980e43b453cb5a30d9535967e7e3441c95afb5b:doDisplay in /usr/share/nginx/html/portal-cetapp/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:453 #16 Twig\Template:displayWithErrorHandling in /usr/share/nginx/html/portal-cetapp/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:420 #15 Twig\Template:display in /usr/share/nginx/html/portal-cetapp/wp-content/cache/gantry5/g5_helium/twig/f6/f6f0849c3c121e3a2a3001a25ab890aedc6f360b7b002b14ff2c7f4dca015833.php:36 #14 __TwigTemplate_b2a4918627ab7ea402c03d46db480afc2b393a4109869db2122d7719f6fdf0d2:doDisplay in /usr/share/nginx/html/portal-cetapp/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:453 #13 Twig\Template:displayWithErrorHandling in /usr/share/nginx/html/portal-cetapp/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:420 #12 Twig\Template:display in /usr/share/nginx/html/portal-cetapp/wp-content/cache/gantry5/g5_helium/twig/e4/e4903eb3129743d2e6b7bfea0d03de0945413a4d61f4cedb3c545823d10b57c2.php:40 #11 __TwigTemplate_3bbd3b1279026934625e86c61a4ed27151de5ed003e2ac3d133fc000394174e3:doDisplay in /usr/share/nginx/html/portal-cetapp/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:453 #10 Twig\Template:displayWithErrorHandling in /usr/share/nginx/html/portal-cetapp/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:420 #9 Twig\Template:display in /usr/share/nginx/html/portal-cetapp/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:432 #8 Twig\Template:render in /usr/share/nginx/html/portal-cetapp/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/TemplateWrapper.php:47 #7 Twig\TemplateWrapper:render in /usr/share/nginx/html/portal-cetapp/wp-content/plugins/gantry5/vendor/timber/timber/lib/Loader.php:79 #6 Timber\Loader:render in /usr/share/nginx/html/portal-cetapp/wp-content/plugins/gantry5/vendor/timber/timber/lib/Timber.php:334 #5 Timber\Timber:compile in /usr/share/nginx/html/portal-cetapp/wp-content/plugins/gantry5/vendor/timber/timber/lib/Timber.php:383 #4 Timber\Timber:fetch in /usr/share/nginx/html/portal-cetapp/wp-content/plugins/gantry5/vendor/timber/timber/lib/Timber.php:410 #3 Timber\Timber:render in /usr/share/nginx/html/portal-cetapp/wp-content/themes/g5_helium/single.php:35 #2 include in /usr/share/nginx/html/portal-cetapp/wp-includes/template-loader.php:125 #1 require_once in /usr/share/nginx/html/portal-cetapp/wp-blog-header.php:19 #0 require in /usr/share/nginx/html/portal-cetapp/index.php:17
Stack frames (31)
30
Twig\Error\RuntimeError
/usr/share/nginx/html/portal-cetapp/wp-content/themes/g5_helium/custom/views/partials/content-single.html.twig22
29
Whoops\Exception\ErrorException
/vendor/timber/timber/lib/ImageHelper.php379
28
Gantry\Component\Whoops\SystemFacade handleError
/vendor/timber/timber/lib/ImageHelper.php379
27
Timber\ImageHelper sideload_image
/vendor/timber/timber/lib/ImageHelper.php588
26
Timber\ImageHelper _operate
/vendor/timber/timber/lib/ImageHelper.php72
25
Timber\ImageHelper resize
/usr/share/nginx/html/portal-cetapp/wp-content/cache/gantry5/g5_helium/twig/6c/6c388b0d4f87d5b256c734bb769bf95bb998f084650e083fde316c7fac77cbb0.php104
24
__TwigTemplate_308b6658394047e02c330373a5ae25e7743b0e2e2094dc5893949f7de9696f21 block_content
/compat/vendor/twig/twig/src/Template.php214
23
Twig\Template displayBlock
/usr/share/nginx/html/portal-cetapp/wp-content/cache/gantry5/g5_helium/twig/6c/6c388b0d4f87d5b256c734bb769bf95bb998f084650e083fde316c7fac77cbb0.php41
22
__TwigTemplate_308b6658394047e02c330373a5ae25e7743b0e2e2094dc5893949f7de9696f21 doDisplay
/compat/vendor/twig/twig/src/Template.php453
21
Twig\Template displayWithErrorHandling
/compat/vendor/twig/twig/src/Template.php420
20
Twig\Template display
/usr/share/nginx/html/portal-cetapp/wp-content/cache/gantry5/g5_helium/twig/e4/e4903eb3129743d2e6b7bfea0d03de0945413a4d61f4cedb3c545823d10b57c2.php54
19
__TwigTemplate_3bbd3b1279026934625e86c61a4ed27151de5ed003e2ac3d133fc000394174e3 block_content
/compat/vendor/twig/twig/src/Template.php214
18
Twig\Template displayBlock
/usr/share/nginx/html/portal-cetapp/wp-content/cache/gantry5/g5_helium/twig/97/975e4c4956e8cd24da58139a06b41318c81396755a97404b9274d439b11c1cdb.php55
17
__TwigTemplate_40d8c2f730ad5a5de20c6a58a980e43b453cb5a30d9535967e7e3441c95afb5b doDisplay
/compat/vendor/twig/twig/src/Template.php453
16
Twig\Template displayWithErrorHandling
/compat/vendor/twig/twig/src/Template.php420
15
Twig\Template display
/usr/share/nginx/html/portal-cetapp/wp-content/cache/gantry5/g5_helium/twig/f6/f6f0849c3c121e3a2a3001a25ab890aedc6f360b7b002b14ff2c7f4dca015833.php36
14
__TwigTemplate_b2a4918627ab7ea402c03d46db480afc2b393a4109869db2122d7719f6fdf0d2 doDisplay
/compat/vendor/twig/twig/src/Template.php453
13
Twig\Template displayWithErrorHandling
/compat/vendor/twig/twig/src/Template.php420
12
Twig\Template display
/usr/share/nginx/html/portal-cetapp/wp-content/cache/gantry5/g5_helium/twig/e4/e4903eb3129743d2e6b7bfea0d03de0945413a4d61f4cedb3c545823d10b57c2.php40
11
__TwigTemplate_3bbd3b1279026934625e86c61a4ed27151de5ed003e2ac3d133fc000394174e3 doDisplay
/compat/vendor/twig/twig/src/Template.php453
10
Twig\Template displayWithErrorHandling
/compat/vendor/twig/twig/src/Template.php420
9
Twig\Template display
/compat/vendor/twig/twig/src/Template.php432
8
Twig\Template render
/compat/vendor/twig/twig/src/TemplateWrapper.php47
7
Twig\TemplateWrapper render
/vendor/timber/timber/lib/Loader.php79
6
Timber\Loader render
/vendor/timber/timber/lib/Timber.php334
5
Timber\Timber compile
/vendor/timber/timber/lib/Timber.php383
4
Timber\Timber fetch
/vendor/timber/timber/lib/Timber.php410
3
Timber\Timber render
/usr/share/nginx/html/portal-cetapp/wp-content/themes/g5_helium/single.php35
2
include
/usr/share/nginx/html/portal-cetapp/wp-includes/template-loader.php125
1
require_once
/usr/share/nginx/html/portal-cetapp/wp-blog-header.php19
0
require
/usr/share/nginx/html/portal-cetapp/index.php17
    {% block content %}
 
        {# Begin Featured Image Only for International category #}
            {% set has_category_113 = false %}
            {% set has_category_101 = false %}
            {% for category in post.terms('category') %}
                {% if category.id == 113 %}
                    {% set has_category_113 = true %}
                {% endif %}
                {% if category.id == 101 %}
                    {% set has_category_101 = true %}
                {% endif %}
            {% endfor %}
            
            {# Begin Entry Header #}
            {% if has_category_113 and not has_category_101 %}
                <section class="entry-header img-featured-header">
                    {% 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') %}
                        <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 }}" />
                    {% endif %}                        
 
                    {% if gantry.config.get('content.' ~ scope ~ '.title.enabled', '1') %}
                        {# Begin Entry Title #}
                        <h2 class="entry-title">
                            {% if gantry.config.get('content.' ~ scope ~ '.title.link', '0') %}
                                <a href="{{ post.link }}" title="{{ post.title }}">{{ post.title }}</a>
                            {% else %}
                                {{ post.title }}
                            {% endif %}
                        </h2>
                        {# End Entry Title #}
                    {% endif %}
 
                    {# Begin Entry Meta #}
                    {% if gantry.config.get('content.' ~ scope ~ '.meta-date.enabled', '1') or gantry.config.get('content.' ~ scope ~ '.meta-author.enabled', '1') or gantry.config.get('content.' ~ scope ~ '.meta-comments.enabled', '1') or gantry.config.get('content.' ~ scope ~ '.meta-categories.enabled', '1') or gantry.config.get('content.' ~ scope ~ '.meta-tags.enabled', '0') %}
                        {% include ['partials/meta-' ~ scope ~ '.html.twig', 'partials/meta.html.twig'] %}
                    {% endif %}
                    {# End Entry Meta #}
 
 
    /**
     * downloads an external image to the server and stores it on the server
     *
     * @param string  $file the URL to the original file
     * @return string the URL to the downloaded file
     */
    public static function sideload_image( $file ) {
        $loc = self::get_sideloaded_file_loc($file);
        if ( file_exists($loc) ) {
            return URLHelper::file_system_to_url($loc);
        }
        // Download file to temp location
        if ( !function_exists('download_url') ) {
            require_once ABSPATH.'/wp-admin/includes/file.php';
        }
        $tmp = download_url($file);
        preg_match('/[^\?]+\.(jpe?g|jpe|gif|png)\b/i', $file, $matches);
        $file_array = array();
        $file_array['name'] = PathHelper::basename($matches[0]);
        $file_array['tmp_name'] = $tmp;
        // If error storing temporarily, do not use
        if ( is_wp_error($tmp) ) {
            $file_array['tmp_name'] = '';
        }
        // do the validation and storage stuff
        $locinfo = PathHelper::pathinfo($loc);
        $file = wp_upload_bits($locinfo['basename'], null, file_get_contents($file_array['tmp_name']));
        // delete tmp file
        @unlink($file_array['tmp_name']);
        return $file['url'];
    }
 
    /**
     * Takes in an URL and breaks it into components,
     * that will then be used in the different steps of image processing.
     * The image is expected to be either part of a theme, plugin, or an upload.
     *
     * @param  string $url an URL (absolute or relative) pointing to an image
     * @return array       an array (see keys in code below)
Exception message: Undefined array key 0
 
    /**
     * downloads an external image to the server and stores it on the server
     *
     * @param string  $file the URL to the original file
     * @return string the URL to the downloaded file
     */
    public static function sideload_image( $file ) {
        $loc = self::get_sideloaded_file_loc($file);
        if ( file_exists($loc) ) {
            return URLHelper::file_system_to_url($loc);
        }
        // Download file to temp location
        if ( !function_exists('download_url') ) {
            require_once ABSPATH.'/wp-admin/includes/file.php';
        }
        $tmp = download_url($file);
        preg_match('/[^\?]+\.(jpe?g|jpe|gif|png)\b/i', $file, $matches);
        $file_array = array();
        $file_array['name'] = PathHelper::basename($matches[0]);
        $file_array['tmp_name'] = $tmp;
        // If error storing temporarily, do not use
        if ( is_wp_error($tmp) ) {
            $file_array['tmp_name'] = '';
        }
        // do the validation and storage stuff
        $locinfo = PathHelper::pathinfo($loc);
        $file = wp_upload_bits($locinfo['basename'], null, file_get_contents($file_array['tmp_name']));
        // delete tmp file
        @unlink($file_array['tmp_name']);
        return $file['url'];
    }
 
    /**
     * Takes in an URL and breaks it into components,
     * that will then be used in the different steps of image processing.
     * The image is expected to be either part of a theme, plugin, or an upload.
     *
     * @param  string $url an URL (absolute or relative) pointing to an image
     * @return array       an array (see keys in code below)
     * @param  object  $op    object of class TimberImageOperation
     * @param  boolean $force if true, remove any already existing result file and forces file generation
     * @return string         URL to the new image - or the source one if error
     *
     */
    private static function _operate( $src, $op, $force = false ) {
        if ( empty($src) ) {
            return '';
        }
 
        $allow_fs_write = apply_filters('timber/allow_fs_write', true);
 
        if ( $allow_fs_write === false ) {
            return $src;
        }
        
        $external = false;
        // if external image, load it first
        if ( URLHelper::is_external_content($src) ) {
            $src = self::sideload_image($src);
            $external = true;
        }
 
        // break down URL into components
        $au = self::analyze_url($src);
 
        // build URL and filenames
        $new_url = self::_get_file_url(
            $au['base'],
            $au['subdir'],
            $op->filename($au['filename'], $au['extension']),
            $au['absolute']
        );
        $destination_path = self::_get_file_path(
            $au['base'],
            $au['subdir'],
            $op->filename($au['filename'], $au['extension'])
        );
        $source_path = self::_get_file_path(
            $au['base'],
     * @example
     * ```twig
     * <img src="{{ image.src | resize(300, 200, 'top') }}" />
     * ```
     * ```html
     * <img src="http://example.org/wp-content/uploads/pic-300x200-c-top.jpg" />
     * ```
     * @return string (ex: )
     */
    public static function resize( $src, $w, $h = 0, $crop = 'default', $force = false ) {
        if ( !is_numeric($w) && is_string($w) ) {
            if ( $sizes = self::find_wp_dimensions($w) ) {
                $w = $sizes['w'];
                $h = $sizes['h'];
            } else {
                return $src;
            }
        }
        $op = new Image\Operation\Resize($w, $h, $crop);
        return self::_operate($src, $op, $force);
    }
 
    /**
     * Find the sizes of an image based on a defined image size
     * @param  string $size the image size to search for
     *                      can be WordPress-defined ("medium")
     *                      or user-defined ("my-awesome-size")
     * @return false|array {
     *     @type int w
     *     @type int h
     * }
     */
    private static function find_wp_dimensions( $size ) {
        global $_wp_additional_image_sizes;
        if ( isset($_wp_additional_image_sizes[$size]) ) {
            $w = $_wp_additional_image_sizes[$size]['width'];
            $h = $_wp_additional_image_sizes[$size]['height'];
        } else if ( in_array($size, array('thumbnail', 'medium', 'large')) ) {
            $w = get_option($size.'_size_w');
            $h = get_option($size.'_size_h');
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['category'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 16
        echo "            
            ";
        // line 18
        echo "            ";
        if ((($context["has_category_113"] ?? null) &&  !($context["has_category_101"] ?? null))) {
            // line 19
            echo "                <section class=\"entry-header img-featured-header\">
                    ";
            // line 20
            if (($this->getAttribute($this->getAttribute(($context["gantry"] ?? null), "config", []), "get", [0 => (("content." . ($context["scope"] ?? null)) . ".featured-image.enabled"), 1 => "1"], "method") && $this->getAttribute($this->getAttribute(($context["post"] ?? null), "thumbnail", []), "src", []))) {
                // line 21
                echo "                        ";
                $context["position"] = ((($this->getAttribute($this->getAttribute(($context["gantry"] ?? null), "config", []), "get", [0 => (("content." . ($context["scope"] ?? null)) . ".featured-image.position"), 1 => "none"], "method") == "none")) ? ("") : (("float-" . $this->getAttribute($this->getAttribute(($context["gantry"] ?? null), "config", []), "get", [0 => (("content." . ($context["scope"] ?? null)) . ".featured-image.position"), 1 => "none"], "method"))));
                // line 22
                echo "                        <img src=\"";
                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 "\" />
                    ";
            }
            // line 23
            echo "                        
 
                    ";
            // line 25
            if ($this->getAttribute($this->getAttribute(($context["gantry"] ?? null), "config", []), "get", [0 => (("content." . ($context["scope"] ?? null)) . ".title.enabled"), 1 => "1"], "method")) {
                // line 26
                echo "                        ";
                // line 27
                echo "                        <h2 class=\"entry-title\">
                            ";
                // line 28
                if ($this->getAttribute($this->getAttribute(($context["gantry"] ?? null), "config", []), "get", [0 => (("content." . ($context["scope"] ?? null)) . ".title.link"), 1 => "0"], "method")) {
 
        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 138
        echo "
</article>";
    }
 
    // line 3
    public function block_content($context, array $blocks = [])
    {
        // line 4
        echo "
        ";
        // line 6
        echo "            ";
        $context["has_category_113"] = false;
        // line 7
        echo "            ";
        $context["has_category_101"] = false;
        // line 8
        echo "            ";
        $context['_parent'] = $context;
            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"] = "single.html.twig";
        // line 3
        $context["scope"] = "single";
        // line 1
        $this->parent = $this->loadTemplate("partials/page.html.twig", "single.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"], "single.html.twig", 11)->display($context);
        // line 12
        echo "
            </section>
        </div> <!-- /content-wrapper -->
    </div>
 
";
    }
 
    public function getTemplateName()
    {
        return "single.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"]) {
            // line 15
            echo "    ";
            if (($this->getAttribute($context["segment"], "type", []) == "offcanvas")) {
                // line 16
                $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;
            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"] = "single.html.twig";
        // line 3
        $context["scope"] = "single";
        // line 1
        $this->parent = $this->loadTemplate("partials/page.html.twig", "single.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"], "single.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);
        } else {
            if ( is_array($filenames) ) {
                $filenames = implode(", ", $filenames);
            }
            Helper::error_log( 'Error loading your template files: '.$filenames.'. Make sure one of these files exists.' );
        }
 
        do_action('timber_compile_done');
        return $output;
    }
 
    /**
     * Compile a string.
     *
     * @api
     * @example
     * ```php
     * $data = array(
     *     'username' => 'Jane Doe',
     * );
        $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
     */
use Timber\Timber;
 
/*
 * The Template for displaying all single posts
 */
 
$gantry = Gantry::instance();
 
/** @var Theme $theme */
$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;
$context['wp_title'] .= ' - ' . $post->title();
 
Timber::render(['single-' . $post->ID . '.html.twig', 'single-' . $post->post_type . '.html.twig', 'single.html.twig'], $context);
 
 
    /**
     * 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 ) {
        /**
         * Fires immediately before including the template.
         *
         * @since 6.9.0
         *
         * @param string $template The path of the template about to be included.
         */
        do_action( 'wp_before_include_template', $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:

empty
empty
empty
empty
empty
Key Value
SERVER_SOFTWARE nginx/1.20.1
REQUEST_URI /acuerdos-comerciales-argelia
USER nginx
HOME /var/lib/nginx
HTTP_ACCEPT_ENCODING gzip, br, zstd, deflate
HTTP_USER_AGENT Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
HTTP_ACCEPT */*
HTTP_X_AMZN_TRACE_ID Root=1-6933b799-44157a18255fe201204675f6
HTTP_HOST portal.ceta.org.co
HTTP_X_FORWARDED_PORT 443
HTTP_X_FORWARDED_PROTO https
HTTP_X_FORWARDED_FOR 216.73.216.137
REDIRECT_STATUS 200
SERVER_NAME portal.ceta.org.co
SERVER_PORT 80
SERVER_ADDR 10.0.0.24
REMOTE_PORT 19996
REMOTE_ADDR 10.1.1.128
GATEWAY_INTERFACE CGI/1.1
REQUEST_SCHEME http
SERVER_PROTOCOL HTTP/1.1
DOCUMENT_ROOT /usr/share/nginx/html/portal-cetapp
DOCUMENT_URI /index.php
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING
SCRIPT_FILENAME /usr/share/nginx/html/portal-cetapp/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1764997017.1083
REQUEST_TIME 1764997017
HTTPS on
empty
0. Whoops\Handler\PrettyPageHandler