TypeError
Timber\Term::__toString(): Return value must be of type string, null returned TypeError thrown with message "Timber\Term::__toString(): Return value must be of type string, null returned" Stacktrace: #24 TypeError in /var/www/mapitout.com/wp-content/plugins/gantry5/vendor/timber/timber/lib/Term.php:82 #23 Timber\Term:__toString in /var/www/mapitout.com/wp-content/cache/gantry5/g5_fiftyfoot_child/twig/93/93a532612b0e069693d373ab1ac6a6bc3cb94b99976dd01c8e131dfd517f3f30.php:64 #22 __TwigTemplate_4b9c9371a4e3462f901b783e20ff1d0fbce45fa3a4c27892cd7db24d3cdbeb3d:block_content in /var/www/mapitout.com/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:214 #21 Twig\Template:displayBlock in /var/www/mapitout.com/wp-content/cache/gantry5/g5_fiftyfoot_child/twig/22/227f27221d59578cf0b2e3a4054184e7c0ab69c73f689a336f90c482bc5a9913.php:55 #20 __TwigTemplate_035fb64c83967584a0a683211fa6c20da134f651a90b6eca00e15f548b6740dc:doDisplay in /var/www/mapitout.com/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:453 #19 Twig\Template:displayWithErrorHandling in /var/www/mapitout.com/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:420 #18 Twig\Template:display in /var/www/mapitout.com/wp-content/cache/gantry5/g5_fiftyfoot_child/twig/28/280cb4e2484518479f6a45d67125522ac454c56f43387de97317108130cb5859.php:36 #17 __TwigTemplate_aa0bb95a19dc922903606eccd425a5d62f86eda9effef4ed0eca3725aff5622c:doDisplay in /var/www/mapitout.com/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:453 #16 Twig\Template:displayWithErrorHandling in /var/www/mapitout.com/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:420 #15 Twig\Template:display in /var/www/mapitout.com/wp-content/cache/gantry5/g5_fiftyfoot_child/twig/93/93a532612b0e069693d373ab1ac6a6bc3cb94b99976dd01c8e131dfd517f3f30.php:38 #14 __TwigTemplate_4b9c9371a4e3462f901b783e20ff1d0fbce45fa3a4c27892cd7db24d3cdbeb3d:doDisplay in /var/www/mapitout.com/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:453 #13 Twig\Template:displayWithErrorHandling in /var/www/mapitout.com/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:420 #12 Twig\Template:display in /var/www/mapitout.com/wp-content/cache/gantry5/g5_fiftyfoot_child/twig/80/80e6b662249b31d0190e51be1755d90e560d2cc2b24b9aac8038107ded6c19d9.php:30 #11 __TwigTemplate_59d5a520e87d9fb3a22ed1641ba00915aaeebc764950932d2c0b34adec520fd5:doDisplay in /var/www/mapitout.com/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:453 #10 Twig\Template:displayWithErrorHandling in /var/www/mapitout.com/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:420 #9 Twig\Template:display in /var/www/mapitout.com/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:432 #8 Twig\Template:render in /var/www/mapitout.com/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/TemplateWrapper.php:47 #7 Twig\TemplateWrapper:render in /var/www/mapitout.com/wp-content/plugins/gantry5/vendor/timber/timber/lib/Loader.php:79 #6 Timber\Loader:render in /var/www/mapitout.com/wp-content/plugins/gantry5/vendor/timber/timber/lib/Timber.php:334 #5 Timber\Timber:compile in /var/www/mapitout.com/wp-content/plugins/gantry5/vendor/timber/timber/lib/Timber.php:383 #4 Timber\Timber:fetch in /var/www/mapitout.com/wp-content/plugins/gantry5/vendor/timber/timber/lib/Timber.php:410 #3 Timber\Timber:render in /var/www/mapitout.com/wp-content/themes/g5_fiftyfoot_child/archive.php:73 #2 include in /var/www/mapitout.com/wp-includes/template-loader.php:106 #1 require_once in /var/www/mapitout.com/wp-blog-header.php:19 #0 require in /var/www/mapitout.com/index.php:17
Stack frames (25)
24
TypeError
/vendor/timber/timber/lib/Term.php82
23
Timber\Term __toString
/var/www/mapitout.com/wp-content/cache/gantry5/g5_fiftyfoot_child/twig/93/93a532612b0e069693d373ab1ac6a6bc3cb94b99976dd01c8e131dfd517f3f30.php64
22
__TwigTemplate_4b9c9371a4e3462f901b783e20ff1d0fbce45fa3a4c27892cd7db24d3cdbeb3d block_content
/compat/vendor/twig/twig/src/Template.php214
21
Twig\Template displayBlock
/var/www/mapitout.com/wp-content/cache/gantry5/g5_fiftyfoot_child/twig/22/227f27221d59578cf0b2e3a4054184e7c0ab69c73f689a336f90c482bc5a9913.php55
20
__TwigTemplate_035fb64c83967584a0a683211fa6c20da134f651a90b6eca00e15f548b6740dc doDisplay
/compat/vendor/twig/twig/src/Template.php453
19
Twig\Template displayWithErrorHandling
/compat/vendor/twig/twig/src/Template.php420
18
Twig\Template display
/var/www/mapitout.com/wp-content/cache/gantry5/g5_fiftyfoot_child/twig/28/280cb4e2484518479f6a45d67125522ac454c56f43387de97317108130cb5859.php36
17
__TwigTemplate_aa0bb95a19dc922903606eccd425a5d62f86eda9effef4ed0eca3725aff5622c doDisplay
/compat/vendor/twig/twig/src/Template.php453
16
Twig\Template displayWithErrorHandling
/compat/vendor/twig/twig/src/Template.php420
15
Twig\Template display
/var/www/mapitout.com/wp-content/cache/gantry5/g5_fiftyfoot_child/twig/93/93a532612b0e069693d373ab1ac6a6bc3cb94b99976dd01c8e131dfd517f3f30.php38
14
__TwigTemplate_4b9c9371a4e3462f901b783e20ff1d0fbce45fa3a4c27892cd7db24d3cdbeb3d doDisplay
/compat/vendor/twig/twig/src/Template.php453
13
Twig\Template displayWithErrorHandling
/compat/vendor/twig/twig/src/Template.php420
12
Twig\Template display
/var/www/mapitout.com/wp-content/cache/gantry5/g5_fiftyfoot_child/twig/80/80e6b662249b31d0190e51be1755d90e560d2cc2b24b9aac8038107ded6c19d9.php30
11
__TwigTemplate_59d5a520e87d9fb3a22ed1641ba00915aaeebc764950932d2c0b34adec520fd5 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
/var/www/mapitout.com/wp-content/themes/g5_fiftyfoot_child/archive.php73
2
include
/var/www/mapitout.com/wp-includes/template-loader.php106
1
require_once
/var/www/mapitout.com/wp-blog-header.php19
0
require
/var/www/mapitout.com/index.php17
 
    /**
     * @param int $tid
     * @param string $tax
     */
    public function __construct( $tid = null, $tax = '' ) {
        if ( $tid === null ) {
            $tid = $this->get_term_from_query();
        }
        if ( strlen($tax) ) {
            $this->taxonomy = $tax;
        }
        $this->init($tid);
    }
 
    /**
     * @return string
     */
    public function __toString() {
        return $this->name;
    }
 
    /**
     * @param $tid
     * @param $taxonomy
     *
     * @return static
     */
    public static function from( $tid, $taxonomy ) {
        if ( is_array($tid) ) {
            return array_map( function($term) use ($taxonomy) {
                return new static($term, $taxonomy);
            }, $tid);
        }
        return new static($tid, $taxonomy);
    }
 
 
    /* Setup
    ===================== */
        echo "
    <div id=\"mapitout_top\"></div>
 
\t<div class=\"platform-advertisers-content\">
\t\t<div class=\"advertisers-archive\">
 
            
 
\t\t\t";
        // line 13
        if ( !twig_test_empty(($context["posts"] ?? null))) {
            // line 14
            echo "
\t\t\t\t<div id=\"adv-categories\" class=\"ff-advertiser-categories g-grid bg-color-4\">
\t\t\t\t\t<div class=\"g-block size-33 ff-advertiser-wheretogo visible-desktop\">
\t\t\t\t\t\t<h3 class=\"uppercase h5-size font-base font-normal color-2\">Where to go</h3>
\t\t\t\t\t\t<div class=\"ff-advertiser-categories-locations center\">
\t\t\t\t\t\t\t<h4 class=\"uppercase color-2 h3-size line-height-1\">";
            // line 19
            echo ($context["current_term"] ?? null);
            echo ", Tx</h4>
\t\t\t\t\t\t\t<a href=\"/#places\" class=\"button h4-size\">Change my Destination</a>
\t\t\t\t\t\t</div>
\t\t\t\t\t</div>
 
\t\t\t\t\t<div class=\"g-block size-5 ff-advertiser-divider\"></div>
                    
\t\t\t\t\t<div class=\"g-block size-62 ff-advertiser-whattodo\">
\t\t\t\t\t\t<h3 class=\"uppercase h5-size font-base font-normal color-2 visible-desktop\">What to do <span class=\"h7-size\" style=\"float: right;\">Select what you are interested in</span></h3>
\t\t\t\t\t\t<div class=\"g-grid color-2\">
\t\t\t\t\t\t\t";
            // line 29
            $context['_parent'] = $context;
            $context['_seq'] = twig_ensure_traversable(($context["cats"] ?? null));
            foreach ($context['_seq'] as $context["_key"] => $context["category"]) {
                // line 30
                echo "\t\t\t\t\t\t\t\t<div class=\"g-block size-33-3 ff-advertiser-category-item uppercase\">
\t\t\t\t\t\t\t\t\t<a class=\"ff-advertiser-category-filter\" href=\"#\" data-category=\"";
                // line 31
                echo $this->getAttribute($context["category"], "slug", []);
 
        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 "\t";
        if ($this->getAttribute($this->getAttribute(($context["gantry"] ?? null), "theme", []), "hasContent", [], "method")) {
            // line 8
            echo "\t\t";
            $this->displayBlock('content', $context, $blocks);
            // line 10
            echo "\t";
        }
        $context["content"] = ('' === $tmp = ob_get_clean()) ? '' : new Markup($tmp, $this->env->getCharset());
        // line 13
        $context["offcanvas"] = null;
        // line 14
        $context['_parent'] = $context;
        $context['_seq'] = twig_ensure_traversable(($context["segments"] ?? null));
        foreach ($context['_seq'] as $context["_key"] => $context["segment"]) {
            if (($this->getAttribute($context["segment"], "type", []) == "offcanvas")) {
                // line 15
                $context["offcanvas"] = $context["segment"];
            }
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['segment'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 18
        ob_start(function () { return ''; });
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
            $this->doDisplay($context, $blocks);
        } catch (Error $e) {
            if (!$e->getSourceContext()) {
                $e->setSourceContext($this->getSourceContext());
            }
 
            // this is mostly useful for \Twig\Error\LoaderError exceptions
            // see \Twig\Error\LoaderError
            if (-1 === $e->getTemplateLine()) {
                $e->guess();
            }
 
            throw $e;
        } catch (\Exception $e) {
            $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
            $e->guess();
 
            throw $e;
        }
    }
 
    {
        return $this;
    }
 
    /**
     * Returns all blocks.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @return array An array of blocks
     */
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
    public function __construct(Environment $env)
    {
        parent::__construct($env);
 
        $this->blocks = [
            'page_head' => [$this, 'block_page_head'],
            'page_footer' => [$this, 'block_page_footer'],
        ];
    }
 
    protected function doGetParent(array $context)
    {
        // line 1
        return "@nucleus/page.html.twig";
    }
 
    protected function doDisplay(array $context, array $blocks = [])
    {
        $this->parent = $this->loadTemplate("@nucleus/page.html.twig", "partials/page.html.twig", 1);
        $this->parent->display($context, array_merge($this->blocks, $blocks));
    }
 
    // line 3
    public function block_page_head($context, array $blocks = [])
    {
        // line 4
        if (($context["page_head"] ?? null)) {
            // line 5
            echo "        ";
            echo ($context["page_head"] ?? null);
            echo "
    ";
        } else {
            // line 7
            echo "        ";
            $this->displayParentBlock("page_head", $context, $blocks);
            echo "
    ";
        }
    }
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
            $this->doDisplay($context, $blocks);
        } catch (Error $e) {
            if (!$e->getSourceContext()) {
                $e->setSourceContext($this->getSourceContext());
            }
 
            // this is mostly useful for \Twig\Error\LoaderError exceptions
            // see \Twig\Error\LoaderError
            if (-1 === $e->getTemplateLine()) {
                $e->guess();
            }
 
            throw $e;
        } catch (\Exception $e) {
            $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
            $e->guess();
 
            throw $e;
        }
    }
 
    {
        return $this;
    }
 
    /**
     * Returns all blocks.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @return array An array of blocks
     */
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
        parent::__construct($env);
 
        $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"] = "archive.html.twig";
        // line 1
        $this->parent = $this->loadTemplate("partials/page.html.twig", "advertisers.html.twig", 1);
        $this->parent->display($context, array_merge($this->blocks, $blocks));
    }
 
    // line 4
    public function block_content($context, array $blocks = [])
    {
        // line 5
        echo "
    <div id=\"mapitout_top\"></div>
 
\t<div class=\"platform-advertisers-content\">
\t\t<div class=\"advertisers-archive\">
 
            
 
\t\t\t";
        // line 13
        if ( !twig_test_empty(($context["posts"] ?? null))) {
            // line 14
            echo "
\t\t\t\t<div id=\"adv-categories\" class=\"ff-advertiser-categories g-grid bg-color-4\">
            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) {
use Twig\Source;
use Twig\Template;
 
/* archive-advertisers.html.twig */
class __TwigTemplate_59d5a520e87d9fb3a22ed1641ba00915aaeebc764950932d2c0b34adec520fd5 extends \Twig\Template
{
    public function __construct(Environment $env)
    {
        parent::__construct($env);
 
        $this->parent = false;
 
        $this->blocks = [
        ];
    }
 
    protected function doDisplay(array $context, array $blocks = [])
    {
        // line 1
        $this->loadTemplate([0 => "advertisers.html.twig"], "archive-advertisers.html.twig", 1)->display($context);
    }
 
    public function getTemplateName()
    {
        return "archive-advertisers.html.twig";
    }
 
    public function isTraitable()
    {
        return false;
    }
 
    public function getDebugInfo()
    {
        return array (  30 => 1,);
    }
 
    /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */
    public function getSource()
    {
            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
     */
    array_unshift($templates, 'archive-' . get_post_type() . '.html.twig');
} else if ($current_term == 'cities') {
    //$context['title'] = post_type_archive_title('', false);
    $context['term'] = get_term_by( 'name', get_query_var('term'), $current_term );
    array_unshift($templates, 'taxonomy-cities.html.twig');
}
 
$context['get_post_type'] = get_post_type();
 
if($context['get_post_type'] == 'advertisers' || $current_term == 'cities'){
    $context['cats'] = Timber::get_terms('category_advertisers', array( 'hide_empty' => 1 ));
}
 
$context['posts'] = Timber::get_posts();
 
 
if(in_array(get_post_type(), ff_get_item_pages())){
    Timber::render( 'items.html.twig', $context );
}else{
    Timber::render($templates, $context);
}
 
 
            }
 
            break;
        }
    }
 
    if ( ! $template ) {
        $template = get_index_template();
    }
 
    /**
     * Filters the path of the current template before including it.
     *
     * @since 3.0.0
     *
     * @param string $template The path of the template to include.
     */
    $template = apply_filters( 'template_include', $template );
    if ( $template ) {
        include $template;
    } elseif ( current_user_can( 'switch_themes' ) ) {
        $theme = wp_get_theme();
        if ( $theme->errors() ) {
            wp_die( $theme->errors() );
        }
    }
    return;
}
 
<?php
/**
 * Loads the WordPress environment and template.
 *
 * @package WordPress
 */
 
if ( ! isset( $wp_did_header ) ) {
 
    $wp_did_header = true;
 
    // Load the WordPress library.
    require_once __DIR__ . '/wp-load.php';
 
    // Set up the WordPress query.
    wp();
 
    // Load the theme template.
    require_once ABSPATH . WPINC . '/template-loader.php';
 
}
 
<?php
/**
 * Front to the WordPress application. This file doesn't do anything, but loads
 * wp-blog-header.php which does and tells WordPress to load the theme.
 *
 * @package WordPress
 */
 
/**
 * Tells WordPress to load the WordPress theme and output it.
 *
 * @var bool
 */
define( 'WP_USE_THEMES', true );
 
/** Loads the WordPress Environment and Template */
require __DIR__ . '/wp-blog-header.php';
 

Environment & details:

empty
empty
empty
empty
empty
Key Value
SERVER_SOFTWARE nginx/1.28.0
REQUEST_URI /advertisers/
USER mapitout
HOME /home/mapitout
HTTP_CF_IPCOUNTRY US
HTTP_CF_CONNECTING_IP 216.73.216.26
HTTP_CDN_LOOP cloudflare; loops=1
HTTP_X_FORWARDED_PROTO https
HTTP_X_FORWARDED_FOR 216.73.216.26
HTTP_CF_RAY 94b05c072ad6e7fa-ORD
HTTP_ACCEPT_ENCODING gzip, br
HTTP_REFERER https://mapitout.com/advertisers
HTTP_ACCEPT */*
HTTP_USER_AGENT Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; [email protected])
HTTP_CF_VISITOR {\"scheme\":\"https\"}
HTTP_HOST mapitout.com
SCRIPT_FILENAME /var/www/mapitout.com/index.php
REDIRECT_STATUS 200
SERVER_NAME mapitout.com
SERVER_PORT 443
SERVER_ADDR 107.191.45.184
REMOTE_USER
REMOTE_PORT 11626
REMOTE_ADDR 216.73.216.26
GATEWAY_INTERFACE CGI/1.1
HTTPS on
REQUEST_SCHEME https
SERVER_PROTOCOL HTTP/2.0
DOCUMENT_ROOT /var/www/mapitout.com
DOCUMENT_URI /index.php
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1749133738.1344
REQUEST_TIME 1749133738
empty
0. Whoops\Handler\PrettyPageHandler