Twig \ Error \ RuntimeError
An exception has been thrown during the rendering of a template ("Array to string conversion").
Previous exceptions
  • Array to string conversion (8)
Twig\Error\RuntimeError thrown with message "An exception has been thrown during the rendering of a template ("Array to string conversion")." Stacktrace: #39 Twig\Error\RuntimeError in /var/www/html/public/content/themes/pbc/templates/components/sidebar/widget-tease.twig:13 #38 Whoops\Exception\ErrorException in /var/www/html/vendor/twig/twig/src/Environment.php:418 #37 Whoops\Run:handleError in /var/www/html/vendor/twig/twig/src/Environment.php:418 #36 __TwigTemplate_ceb27a34dad16bf9ac5cfbd3c1081fb205c4938141165f96a52b32cb4d3fe0b2___2112786822:block_linkContent in /var/www/html/vendor/twig/twig/src/Template.php:182 #35 Twig\Template:displayBlock in /var/www/html/vendor/twig/twig/src/Environment.php:418 #34 __TwigTemplate_18cb4755b04b51c04b457080fc1242daf10b0003eae8c049b8ffc02fa94f454e:doDisplay in /var/www/html/vendor/twig/twig/src/Template.php:405 #33 Twig\Template:displayWithErrorHandling in /var/www/html/vendor/twig/twig/src/Template.php:378 #32 Twig\Template:display in /var/www/html/vendor/twig/twig/src/Environment.php:418 #31 __TwigTemplate_ceb27a34dad16bf9ac5cfbd3c1081fb205c4938141165f96a52b32cb4d3fe0b2___2112786822:doDisplay in /var/www/html/vendor/twig/twig/src/Template.php:405 #30 Twig\Template:displayWithErrorHandling in /var/www/html/vendor/twig/twig/src/Template.php:378 #29 Twig\Template:display in /var/www/html/vendor/twig/twig/src/Environment.php:418 #28 __TwigTemplate_ceb27a34dad16bf9ac5cfbd3c1081fb205c4938141165f96a52b32cb4d3fe0b2:doDisplay in /var/www/html/vendor/twig/twig/src/Template.php:405 #27 Twig\Template:displayWithErrorHandling in /var/www/html/vendor/twig/twig/src/Template.php:378 #26 Twig\Template:display in /var/www/html/vendor/twig/twig/src/Environment.php:418 #25 __TwigTemplate_a5f48e9cc98e8fdb0b2a87d8e5576f848706d9a480c252c12720d1d5aaaa5bbe___611401677:block_content in /var/www/html/vendor/twig/twig/src/Template.php:182 #24 Twig\Template:displayBlock in /var/www/html/vendor/twig/twig/src/Environment.php:418 #23 __TwigTemplate_1f05b9bd79ff8c4050dcbe96b098be05d733db3d636c1f7cc7a7c061cb8199b1:doDisplay in /var/www/html/vendor/twig/twig/src/Template.php:405 #22 Twig\Template:displayWithErrorHandling in /var/www/html/vendor/twig/twig/src/Template.php:378 #21 Twig\Template:display in /var/www/html/vendor/twig/twig/src/Environment.php:418 #20 __TwigTemplate_a5f48e9cc98e8fdb0b2a87d8e5576f848706d9a480c252c12720d1d5aaaa5bbe___611401677:doDisplay in /var/www/html/vendor/twig/twig/src/Template.php:405 #19 Twig\Template:displayWithErrorHandling in /var/www/html/vendor/twig/twig/src/Template.php:378 #18 Twig\Template:display in /var/www/html/vendor/twig/twig/src/Environment.php:418 #17 __TwigTemplate_a5f48e9cc98e8fdb0b2a87d8e5576f848706d9a480c252c12720d1d5aaaa5bbe:doDisplay in /var/www/html/vendor/twig/twig/src/Template.php:405 #16 Twig\Template:displayWithErrorHandling in /var/www/html/vendor/twig/twig/src/Template.php:378 #15 Twig\Template:display in /var/www/html/vendor/twig/twig/src/Environment.php:418 #14 __TwigTemplate_e35d407f86b79714f0ed81d680679ec01a237e85b6270bb2900872adf08b7aae:doDisplay in /var/www/html/vendor/twig/twig/src/Template.php:405 #13 Twig\Template:displayWithErrorHandling in /var/www/html/vendor/twig/twig/src/Template.php:378 #12 Twig\Template:display in /var/www/html/vendor/twig/twig/src/Template.php:390 #11 Twig\Template:render in /var/www/html/vendor/twig/twig/src/TemplateWrapper.php:45 #10 Twig\TemplateWrapper:render in /var/www/html/vendor/timber/timber/lib/Loader.php:79 #9 Timber\Loader:render in /var/www/html/vendor/timber/timber/lib/Timber.php:334 #8 Timber\Timber:compile in /var/www/html/vendor/timber/timber/lib/Timber.php:383 #7 Timber\Timber:fetch in /var/www/html/vendor/timber/timber/lib/Timber.php:410 #6 Timber\Timber:render in /var/www/html/public/content/themes/pbc/sidebar.php:59 #5 include in /var/www/html/vendor/timber/timber/lib/Timber.php:469 #4 Timber\Timber:get_sidebar_from_php in /var/www/html/vendor/timber/timber/lib/Timber.php:450 #3 Timber\Timber:get_sidebar in /var/www/html/public/content/themes/pbc/archive.php:49 #2 include in /var/www/html/public/wordpress/wp-includes/template-loader.php:106 #1 require_once in /var/www/html/public/wordpress/wp-blog-header.php:19 #0 require in /var/www/html/public/index.php:14
39
Twig\Error\RuntimeError
/public/content/themes/pbc/templates/components/sidebar/widget-tease.twig13
38
Whoops\Exception\ErrorException
/vendor/twig/twig/src/Environment.php418
37
Whoops\Run handleError
/vendor/twig/twig/src/Environment.php418
36
__TwigTemplate_ceb27a34dad16bf9ac5cfbd3c1081fb205c4938141165f96a52b32cb4d3fe0b2___2112786822 block_linkContent
/vendor/twig/twig/src/Template.php182
35
Twig\Template displayBlock
/vendor/twig/twig/src/Environment.php418
34
__TwigTemplate_18cb4755b04b51c04b457080fc1242daf10b0003eae8c049b8ffc02fa94f454e doDisplay
/vendor/twig/twig/src/Template.php405
33
Twig\Template displayWithErrorHandling
/vendor/twig/twig/src/Template.php378
32
Twig\Template display
/vendor/twig/twig/src/Environment.php418
31
__TwigTemplate_ceb27a34dad16bf9ac5cfbd3c1081fb205c4938141165f96a52b32cb4d3fe0b2___2112786822 doDisplay
/vendor/twig/twig/src/Template.php405
30
Twig\Template displayWithErrorHandling
/vendor/twig/twig/src/Template.php378
29
Twig\Template display
/vendor/twig/twig/src/Environment.php418
28
__TwigTemplate_ceb27a34dad16bf9ac5cfbd3c1081fb205c4938141165f96a52b32cb4d3fe0b2 doDisplay
/vendor/twig/twig/src/Template.php405
27
Twig\Template displayWithErrorHandling
/vendor/twig/twig/src/Template.php378
26
Twig\Template display
/vendor/twig/twig/src/Environment.php418
25
__TwigTemplate_a5f48e9cc98e8fdb0b2a87d8e5576f848706d9a480c252c12720d1d5aaaa5bbe___611401677 block_content
/vendor/twig/twig/src/Template.php182
24
Twig\Template displayBlock
/vendor/twig/twig/src/Environment.php418
23
__TwigTemplate_1f05b9bd79ff8c4050dcbe96b098be05d733db3d636c1f7cc7a7c061cb8199b1 doDisplay
/vendor/twig/twig/src/Template.php405
22
Twig\Template displayWithErrorHandling
/vendor/twig/twig/src/Template.php378
21
Twig\Template display
/vendor/twig/twig/src/Environment.php418
20
__TwigTemplate_a5f48e9cc98e8fdb0b2a87d8e5576f848706d9a480c252c12720d1d5aaaa5bbe___611401677 doDisplay
/vendor/twig/twig/src/Template.php405
19
Twig\Template displayWithErrorHandling
/vendor/twig/twig/src/Template.php378
18
Twig\Template display
/vendor/twig/twig/src/Environment.php418
17
__TwigTemplate_a5f48e9cc98e8fdb0b2a87d8e5576f848706d9a480c252c12720d1d5aaaa5bbe doDisplay
/vendor/twig/twig/src/Template.php405
16
Twig\Template displayWithErrorHandling
/vendor/twig/twig/src/Template.php378
15
Twig\Template display
/vendor/twig/twig/src/Environment.php418
14
__TwigTemplate_e35d407f86b79714f0ed81d680679ec01a237e85b6270bb2900872adf08b7aae doDisplay
/vendor/twig/twig/src/Template.php405
13
Twig\Template displayWithErrorHandling
/vendor/twig/twig/src/Template.php378
12
Twig\Template display
/vendor/twig/twig/src/Template.php390
11
Twig\Template render
/vendor/twig/twig/src/TemplateWrapper.php45
10
Twig\TemplateWrapper render
/vendor/timber/timber/lib/Loader.php79
9
Timber\Loader render
/vendor/timber/timber/lib/Timber.php334
8
Timber\Timber compile
/vendor/timber/timber/lib/Timber.php383
7
Timber\Timber fetch
/vendor/timber/timber/lib/Timber.php410
6
Timber\Timber render
/public/content/themes/pbc/sidebar.php59
5
include
/vendor/timber/timber/lib/Timber.php469
4
Timber\Timber get_sidebar_from_php
/vendor/timber/timber/lib/Timber.php450
3
Timber\Timber get_sidebar
/public/content/themes/pbc/archive.php49
2
include
/public/wordpress/wp-includes/template-loader.php106
1
require_once
/public/wordpress/wp-blog-header.php19
0
require
/public/index.php14
/var/www/html/public/content/themes/pbc/templates/components/sidebar/widget-tease.twig
<article class="col-xs-12 col-sm-12 col-md-12 widget-tease">
    {# {% block thumbnail %} #}
        {% include "@atoms/image.twig" with {
            item: item.get_thumbnail,
            childClasses: "widget-tease__image",
            parentClasses: "widget-tease__image-container",
            link: item.link
        } %}
    {# {% endblock %} #}
    <div class="widget-tease__content">
        {% embed '@atoms/link.twig' with {link: item.link, linkClass: "widget-tease__title-link"} %}
            {% block linkContent %}
                <h4 class="widget-tease__title tease-small__title">{{item.custom.promo ?: item.title}}</h4>
            {% endblock %}
        {% endembed %}
        <div class="widget-tease__meta">
            {% include "@components/author-override.twig" with {authors: item.get_authors, classes: "widget-tease__meta-item tease-large__meta-item widget-tease__author-link meta-item tease-item__author-link"} %}
        </div>
    </div>
</article>
/var/www/html/vendor/twig/twig/src/Environment.php
            $key = $this->cache->generateKey($name, $mainCls);
 
            if (!$this->isAutoReload() || $this->isTemplateFresh($name, $this->cache->getTimestamp($key))) {
                $this->cache->load($key);
            }
 
            $source = null;
            if (!class_exists($cls, false)) {
                $source = $this->getLoader()->getSourceContext($name);
                $content = $this->compileSource($source);
                $this->cache->write($key, $content);
                $this->cache->load($key);
 
                if (!class_exists($mainCls, false)) {
                    /* Last line of defense if either $this->bcWriteCacheFile was used,
                     * $this->cache is implemented as a no-op or we have a race condition
                     * where the cache was cleared between the above calls to write to and load from
                     * the cache.
                     */
                    eval('?>'.$content);
                }
 
                if (!class_exists($cls, false)) {
                    throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
                }
            }
        }
 
        // to be removed in 3.0
        $this->extensionSet->initRuntime($this);
 
        return $this->loadedTemplates[$cls] = new $cls($this);
    }
 
    /**
     * Creates a template from source.
     *
     * This method should not be used as a generic way to load templates.
     *
     * @param string $template The template source
Exception message: Array to string conversion
/var/www/html/vendor/twig/twig/src/Environment.php
            $key = $this->cache->generateKey($name, $mainCls);
 
            if (!$this->isAutoReload() || $this->isTemplateFresh($name, $this->cache->getTimestamp($key))) {
                $this->cache->load($key);
            }
 
            $source = null;
            if (!class_exists($cls, false)) {
                $source = $this->getLoader()->getSourceContext($name);
                $content = $this->compileSource($source);
                $this->cache->write($key, $content);
                $this->cache->load($key);
 
                if (!class_exists($mainCls, false)) {
                    /* Last line of defense if either $this->bcWriteCacheFile was used,
                     * $this->cache is implemented as a no-op or we have a race condition
                     * where the cache was cleared between the above calls to write to and load from
                     * the cache.
                     */
                    eval('?>'.$content);
                }
 
                if (!class_exists($cls, false)) {
                    throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
                }
            }
        }
 
        // to be removed in 3.0
        $this->extensionSet->initRuntime($this);
 
        return $this->loadedTemplates[$cls] = new $cls($this);
    }
 
    /**
     * Creates a template from source.
     *
     * This method should not be used as a generic way to load templates.
     *
     * @param string $template The template source
/var/www/html/vendor/twig/twig/src/Template.php
    {
        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, $templateContext ?? $this);
/var/www/html/vendor/twig/twig/src/Environment.php
            $key = $this->cache->generateKey($name, $mainCls);
 
            if (!$this->isAutoReload() || $this->isTemplateFresh($name, $this->cache->getTimestamp($key))) {
                $this->cache->load($key);
            }
 
            $source = null;
            if (!class_exists($cls, false)) {
                $source = $this->getLoader()->getSourceContext($name);
                $content = $this->compileSource($source);
                $this->cache->write($key, $content);
                $this->cache->load($key);
 
                if (!class_exists($mainCls, false)) {
                    /* Last line of defense if either $this->bcWriteCacheFile was used,
                     * $this->cache is implemented as a no-op or we have a race condition
                     * where the cache was cleared between the above calls to write to and load from
                     * the cache.
                     */
                    eval('?>'.$content);
                }
 
                if (!class_exists($cls, false)) {
                    throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
                }
            }
        }
 
        // to be removed in 3.0
        $this->extensionSet->initRuntime($this);
 
        return $this->loadedTemplates[$cls] = new $cls($this);
    }
 
    /**
     * Creates a template from source.
     *
     * This method should not be used as a generic way to load templates.
     *
     * @param string $template The template source
/var/www/html/vendor/twig/twig/src/Template.php
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } 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;
        }
    }
 
/var/www/html/vendor/twig/twig/src/Template.php
    {
        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 (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
/var/www/html/vendor/twig/twig/src/Environment.php
            $key = $this->cache->generateKey($name, $mainCls);
 
            if (!$this->isAutoReload() || $this->isTemplateFresh($name, $this->cache->getTimestamp($key))) {
                $this->cache->load($key);
            }
 
            $source = null;
            if (!class_exists($cls, false)) {
                $source = $this->getLoader()->getSourceContext($name);
                $content = $this->compileSource($source);
                $this->cache->write($key, $content);
                $this->cache->load($key);
 
                if (!class_exists($mainCls, false)) {
                    /* Last line of defense if either $this->bcWriteCacheFile was used,
                     * $this->cache is implemented as a no-op or we have a race condition
                     * where the cache was cleared between the above calls to write to and load from
                     * the cache.
                     */
                    eval('?>'.$content);
                }
 
                if (!class_exists($cls, false)) {
                    throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
                }
            }
        }
 
        // to be removed in 3.0
        $this->extensionSet->initRuntime($this);
 
        return $this->loadedTemplates[$cls] = new $cls($this);
    }
 
    /**
     * Creates a template from source.
     *
     * This method should not be used as a generic way to load templates.
     *
     * @param string $template The template source
/var/www/html/vendor/twig/twig/src/Template.php
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } 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;
        }
    }
 
/var/www/html/vendor/twig/twig/src/Template.php
    {
        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 (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
/var/www/html/vendor/twig/twig/src/Environment.php
            $key = $this->cache->generateKey($name, $mainCls);
 
            if (!$this->isAutoReload() || $this->isTemplateFresh($name, $this->cache->getTimestamp($key))) {
                $this->cache->load($key);
            }
 
            $source = null;
            if (!class_exists($cls, false)) {
                $source = $this->getLoader()->getSourceContext($name);
                $content = $this->compileSource($source);
                $this->cache->write($key, $content);
                $this->cache->load($key);
 
                if (!class_exists($mainCls, false)) {
                    /* Last line of defense if either $this->bcWriteCacheFile was used,
                     * $this->cache is implemented as a no-op or we have a race condition
                     * where the cache was cleared between the above calls to write to and load from
                     * the cache.
                     */
                    eval('?>'.$content);
                }
 
                if (!class_exists($cls, false)) {
                    throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
                }
            }
        }
 
        // to be removed in 3.0
        $this->extensionSet->initRuntime($this);
 
        return $this->loadedTemplates[$cls] = new $cls($this);
    }
 
    /**
     * Creates a template from source.
     *
     * This method should not be used as a generic way to load templates.
     *
     * @param string $template The template source
/var/www/html/vendor/twig/twig/src/Template.php
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } 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;
        }
    }
 
/var/www/html/vendor/twig/twig/src/Template.php
    {
        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 (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
/var/www/html/vendor/twig/twig/src/Environment.php
            $key = $this->cache->generateKey($name, $mainCls);
 
            if (!$this->isAutoReload() || $this->isTemplateFresh($name, $this->cache->getTimestamp($key))) {
                $this->cache->load($key);
            }
 
            $source = null;
            if (!class_exists($cls, false)) {
                $source = $this->getLoader()->getSourceContext($name);
                $content = $this->compileSource($source);
                $this->cache->write($key, $content);
                $this->cache->load($key);
 
                if (!class_exists($mainCls, false)) {
                    /* Last line of defense if either $this->bcWriteCacheFile was used,
                     * $this->cache is implemented as a no-op or we have a race condition
                     * where the cache was cleared between the above calls to write to and load from
                     * the cache.
                     */
                    eval('?>'.$content);
                }
 
                if (!class_exists($cls, false)) {
                    throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
                }
            }
        }
 
        // to be removed in 3.0
        $this->extensionSet->initRuntime($this);
 
        return $this->loadedTemplates[$cls] = new $cls($this);
    }
 
    /**
     * Creates a template from source.
     *
     * This method should not be used as a generic way to load templates.
     *
     * @param string $template The template source
/var/www/html/vendor/twig/twig/src/Template.php
    {
        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, $templateContext ?? $this);
/var/www/html/vendor/twig/twig/src/Environment.php
            $key = $this->cache->generateKey($name, $mainCls);
 
            if (!$this->isAutoReload() || $this->isTemplateFresh($name, $this->cache->getTimestamp($key))) {
                $this->cache->load($key);
            }
 
            $source = null;
            if (!class_exists($cls, false)) {
                $source = $this->getLoader()->getSourceContext($name);
                $content = $this->compileSource($source);
                $this->cache->write($key, $content);
                $this->cache->load($key);
 
                if (!class_exists($mainCls, false)) {
                    /* Last line of defense if either $this->bcWriteCacheFile was used,
                     * $this->cache is implemented as a no-op or we have a race condition
                     * where the cache was cleared between the above calls to write to and load from
                     * the cache.
                     */
                    eval('?>'.$content);
                }
 
                if (!class_exists($cls, false)) {
                    throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
                }
            }
        }
 
        // to be removed in 3.0
        $this->extensionSet->initRuntime($this);
 
        return $this->loadedTemplates[$cls] = new $cls($this);
    }
 
    /**
     * Creates a template from source.
     *
     * This method should not be used as a generic way to load templates.
     *
     * @param string $template The template source
/var/www/html/vendor/twig/twig/src/Template.php
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } 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;
        }
    }
 
/var/www/html/vendor/twig/twig/src/Template.php
    {
        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 (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
/var/www/html/vendor/twig/twig/src/Environment.php
            $key = $this->cache->generateKey($name, $mainCls);
 
            if (!$this->isAutoReload() || $this->isTemplateFresh($name, $this->cache->getTimestamp($key))) {
                $this->cache->load($key);
            }
 
            $source = null;
            if (!class_exists($cls, false)) {
                $source = $this->getLoader()->getSourceContext($name);
                $content = $this->compileSource($source);
                $this->cache->write($key, $content);
                $this->cache->load($key);
 
                if (!class_exists($mainCls, false)) {
                    /* Last line of defense if either $this->bcWriteCacheFile was used,
                     * $this->cache is implemented as a no-op or we have a race condition
                     * where the cache was cleared between the above calls to write to and load from
                     * the cache.
                     */
                    eval('?>'.$content);
                }
 
                if (!class_exists($cls, false)) {
                    throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
                }
            }
        }
 
        // to be removed in 3.0
        $this->extensionSet->initRuntime($this);
 
        return $this->loadedTemplates[$cls] = new $cls($this);
    }
 
    /**
     * Creates a template from source.
     *
     * This method should not be used as a generic way to load templates.
     *
     * @param string $template The template source
/var/www/html/vendor/twig/twig/src/Template.php
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } 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;
        }
    }
 
/var/www/html/vendor/twig/twig/src/Template.php
    {
        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 (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
/var/www/html/vendor/twig/twig/src/Environment.php
            $key = $this->cache->generateKey($name, $mainCls);
 
            if (!$this->isAutoReload() || $this->isTemplateFresh($name, $this->cache->getTimestamp($key))) {
                $this->cache->load($key);
            }
 
            $source = null;
            if (!class_exists($cls, false)) {
                $source = $this->getLoader()->getSourceContext($name);
                $content = $this->compileSource($source);
                $this->cache->write($key, $content);
                $this->cache->load($key);
 
                if (!class_exists($mainCls, false)) {
                    /* Last line of defense if either $this->bcWriteCacheFile was used,
                     * $this->cache is implemented as a no-op or we have a race condition
                     * where the cache was cleared between the above calls to write to and load from
                     * the cache.
                     */
                    eval('?>'.$content);
                }
 
                if (!class_exists($cls, false)) {
                    throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
                }
            }
        }
 
        // to be removed in 3.0
        $this->extensionSet->initRuntime($this);
 
        return $this->loadedTemplates[$cls] = new $cls($this);
    }
 
    /**
     * Creates a template from source.
     *
     * This method should not be used as a generic way to load templates.
     *
     * @param string $template The template source
/var/www/html/vendor/twig/twig/src/Template.php
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } 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;
        }
    }
 
/var/www/html/vendor/twig/twig/src/Template.php
    {
        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 (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
/var/www/html/vendor/twig/twig/src/Environment.php
            $key = $this->cache->generateKey($name, $mainCls);
 
            if (!$this->isAutoReload() || $this->isTemplateFresh($name, $this->cache->getTimestamp($key))) {
                $this->cache->load($key);
            }
 
            $source = null;
            if (!class_exists($cls, false)) {
                $source = $this->getLoader()->getSourceContext($name);
                $content = $this->compileSource($source);
                $this->cache->write($key, $content);
                $this->cache->load($key);
 
                if (!class_exists($mainCls, false)) {
                    /* Last line of defense if either $this->bcWriteCacheFile was used,
                     * $this->cache is implemented as a no-op or we have a race condition
                     * where the cache was cleared between the above calls to write to and load from
                     * the cache.
                     */
                    eval('?>'.$content);
                }
 
                if (!class_exists($cls, false)) {
                    throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
                }
            }
        }
 
        // to be removed in 3.0
        $this->extensionSet->initRuntime($this);
 
        return $this->loadedTemplates[$cls] = new $cls($this);
    }
 
    /**
     * Creates a template from source.
     *
     * This method should not be used as a generic way to load templates.
     *
     * @param string $template The template source
/var/www/html/vendor/twig/twig/src/Template.php
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } 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;
        }
    }
 
/var/www/html/vendor/twig/twig/src/Template.php
    {
        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 (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
/var/www/html/vendor/twig/twig/src/Template.php
    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 (\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());
            }
 
/var/www/html/vendor/twig/twig/src/TemplateWrapper.php
     * directly (use Twig\Environment::load() instead).
     *
     * @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
     */
    public function render(array $context = []): string
    {
        // 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_get_args()[1] ?? []);
    }
 
    /**
     * Displays the template.
     *
     * @param array $context An array of parameters to pass to the template
     */
    public function display(array $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_get_args()[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
     */
/var/www/html/vendor/timber/timber/lib/Loader.php
 
        $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.
     */
/var/www/html/vendor/timber/timber/lib/Timber.php
        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',
     * );
/var/www/html/vendor/timber/timber/lib/Timber.php
        $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
/var/www/html/vendor/timber/timber/lib/Timber.php
     * 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
     */
/var/www/html/public/content/themes/pbc/sidebar.php
    $cat = isset($the_object->term_id) ? $the_object->term_id : false;
}
if(is_singular('post')){
    $full_cat = get_the_category();
    $tax = 'cat';
    $cat = $full_cat[0]->term_id;
    $context['popular']['title'] = 'Popular in '.$full_cat[0]->name;
}
 
    //posts[0].category
$opts = [
    'post_type' => $post_type,
    'posts_per_page' => 4,
];
if($tax) $opts[$tax] = $cat;
$context['popular']['posts'] = Timber::get_posts($opts,'\PBC\Post');
 
$context['ad_code'] = "P2_SIDEBAR_".(isset($context['user']) && $context['user'] ? "LOGGED_IN_" : "");
 
Timber::render( array( 'sidebar.twig' ), $context );
wp_reset_query();
/var/www/html/vendor/timber/timber/lib/Timber.php
            return self::get_sidebar_from_php($sidebar, $data);
        }
        return self::compile($sidebar, $data);
    }
 
    /**
     * Get sidebar from PHP
     * @api
     * @param string  $sidebar
     * @param array   $data
     * @return string
     */
    public static function get_sidebar_from_php( $sidebar = '', $data ) {
        $caller = LocationManager::get_calling_script_dir(1);
        $uris = LocationManager::get_locations($caller);
        ob_start();
        $found = false;
        foreach ( $uris as $uri ) {
            if ( file_exists(trailingslashit($uri).$sidebar) ) {
                include trailingslashit($uri).$sidebar;
                $found = true;
                break;
            }
        }
        if ( !$found ) {
            Helper::error_log('error loading your sidebar, check to make sure the file exists');
        }
        $ret = ob_get_contents();
        ob_end_clean();
        return $ret;
    }
 
    /* Widgets
    ================================ */
 
    /**
     * Get widgets.
     *
     * @api
     * @param int|string $widget_id Optional. Index, name or ID of dynamic sidebar. Default 1.
/var/www/html/vendor/timber/timber/lib/Timber.php
    public static function render_string( $string, $data = array() ) {
        $compiled = self::compile_string($string, $data);
        echo $compiled;
        return $compiled;
    }
 
 
    /*  Sidebar
    ================================ */
 
    /**
     * Get sidebar.
     * @api
     * @param string  $sidebar
     * @param array   $data
     * @return bool|string
     */
    public static function get_sidebar( $sidebar = 'sidebar.php', $data = array() ) {
        if ( strstr(strtolower($sidebar), '.php') ) {
            return self::get_sidebar_from_php($sidebar, $data);
        }
        return self::compile($sidebar, $data);
    }
 
    /**
     * Get sidebar from PHP
     * @api
     * @param string  $sidebar
     * @param array   $data
     * @return string
     */
    public static function get_sidebar_from_php( $sidebar = '', $data ) {
        $caller = LocationManager::get_calling_script_dir(1);
        $uris = LocationManager::get_locations($caller);
        ob_start();
        $found = false;
        foreach ( $uris as $uri ) {
            if ( file_exists(trailingslashit($uri).$sidebar) ) {
                include trailingslashit($uri).$sidebar;
                $found = true;
/var/www/html/public/content/themes/pbc/archive.php
} else if ( is_tag() ) {
    $context['title'] = 'Tag: '.ucfirst(single_tag_title( '', false ));
    $context['category']['name'] = ucfirst(single_tag_title( '', false ));
    $context['description'] = term_description();
} else if ( is_category() ) {
    $context['category']['name'] = single_cat_title( '', false );
    $context['description'] = term_description();
    array_unshift( $templates, 'archive-' . get_query_var( 'cat' ) . '.twig' );
} else if ( is_post_type_archive() ) {
    $context['title'] = post_type_archive_title( '', false );
    array_unshift( $templates, 'archive-' . get_post_type() . '.twig' );
}
 
 
pbc_augment_timber_pagination($context);
 
$category = isset(get_queried_object()->term_id) ? get_queried_object()->term_id : '';
 
 
$context['sidebar'] = Timber::get_sidebar('sidebar.php', $context);
 
Timber::render( $templates, $context );
/var/www/html/public/wordpress/wp-includes/template-loader.php
            }
 
            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;
}
 
/var/www/html/public/wordpress/wp-blog-header.php
<?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';
 
}
 
/var/www/html/public/index.php
<?php
 
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
 
// WordPress view bootstrapper
define( 'WP_USE_THEMES', true );
 
// composer auto loader, symlinks all colliding, this should resolve the relative include paths correctly
//chdir( dirname ( realpath ( __FILE__ ) ) );
 
//require( '../vendor/autoload.php' );
require( './wordpress/wp-blog-header.php');

Environment & details:

empty
empty
empty
empty
Key Value
signup-auth 145568007360087d60ddbd61.87778682
Key Value
SERVER_SOFTWARE nginx/1.18.0
REQUEST_URI /topics/jordan
USER nobody
HOME /
HTTP_ACCEPT_ENCODING br,gzip
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/)
HTTP_X_AMZN_TRACE_ID Root=1-60087d60-1d099d3076455d0d0ea12c78
HTTP_HOST www.prospectmagazine.co.uk
HTTP_X_FORWARDED_PORT 443
HTTP_X_FORWARDED_PROTO https
HTTP_X_FORWARDED_FOR 3.236.156.34
REDIRECT_STATUS 200
SERVER_NAME _
SERVER_PORT 443
SERVER_ADDR 172.17.0.2
REMOTE_PORT 32676
REMOTE_ADDR 172.31.47.190
GATEWAY_INTERFACE CGI/1.1
HTTPS on
REQUEST_SCHEME https
SERVER_PROTOCOL HTTP/1.1
DOCUMENT_ROOT ********************
DOCUMENT_URI /index.php
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING
SCRIPT_FILENAME ******************************
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1611169120.8874
REQUEST_TIME 1611169120
COMPOSER_ALLOW_SUPERUSER 1
DB_HOST *******************************************************************************
DB_NAME *************
DB_PASSWORD ******************
DB_USER ***************
FILE_SYSTEM_ID fs-afce5066
GOOGLE_AD_MANAGER_ACTIVE true
GOOGLE_AD_MANAGER_ID 21688349148
HOSTNAME ce67dd27ba65
MAGICK_HOME /usr
MOUNT_DIRECTORY /efs
PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PHP_INI_DIR /etc/php7
PWD /var/www/html
SESSION_SAVE_HANDLER redis
SHLVL 1
WP_ENV **********
WP_HOME **********************************
WP_REDIS_HOST prospect-redis-cache.eui3wf.0001.euw1.cache.amazonaws.com
WP_SITEURL ********************************************
Key Value
COMPOSER_ALLOW_SUPERUSER 1
DB_HOST *******************************************************************************
DB_NAME *************
DB_PASSWORD ******************
DB_USER ***************
FILE_SYSTEM_ID fs-afce5066
GOOGLE_AD_MANAGER_ACTIVE true
GOOGLE_AD_MANAGER_ID 21688349148
HOSTNAME ce67dd27ba65
MAGICK_HOME /usr
MOUNT_DIRECTORY /efs
PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PHP_INI_DIR /etc/php7
PWD /var/www/html
SESSION_SAVE_HANDLER redis
SHLVL 1
WP_ENV **********
WP_HOME **********************************
WP_REDIS_HOST prospect-redis-cache.eui3wf.0001.euw1.cache.amazonaws.com
WP_SITEURL ********************************************
0. Whoops\Handler\PrettyPageHandler