Twig \ Error \ RuntimeError
An exception has been thrown during the rendering of a template ("Undefined array key "phone"").
Previous exceptions
  • Undefined array key "phone" (2)
Twig\Error\RuntimeError thrown with message "An exception has been thrown during the rendering of a template ("Undefined array key "phone"")." Stacktrace: #31 Twig\Error\RuntimeError in /home/3/w/wallop/meny/wp-content/themes/g5_helium-child/views/partials/content-single.html.twig:25 #30 Whoops\Exception\ErrorException in /home/3/w/wallop/meny/wp-content/themes/g5_helium-child/functions.php:86 #29 Gantry\Component\Whoops\SystemFacade:handleError in /home/3/w/wallop/meny/wp-content/themes/g5_helium-child/functions.php:86 #28 get_menyer_magic_info in /home/3/w/wallop/meny/wp-content/plugins/gantry5/vendor/timber/timber/lib/Twig.php:296 #27 call_user_func_array in /home/3/w/wallop/meny/wp-content/plugins/gantry5/vendor/timber/timber/lib/Twig.php:296 #26 Timber\Twig:exec_function in /home/3/w/wallop/meny/wp-content/cache/gantry5/g5_helium-child/twig/95/9549c4fc25d7dd240ab3520596072c0219b933d2ebbd465cfa8732871a8861bc.php:102 #25 __TwigTemplate_b4883e13f3a806e6ffac844cd7ee517712166ee39d355e55794dd12a5456a57a:block_content in /home/3/w/wallop/meny/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:214 #24 Twig\Template:displayBlock in /home/3/w/wallop/meny/wp-content/cache/gantry5/g5_helium-child/twig/95/9549c4fc25d7dd240ab3520596072c0219b933d2ebbd465cfa8732871a8861bc.php:41 #23 __TwigTemplate_b4883e13f3a806e6ffac844cd7ee517712166ee39d355e55794dd12a5456a57a:doDisplay in /home/3/w/wallop/meny/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:453 #22 Twig\Template:displayWithErrorHandling in /home/3/w/wallop/meny/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:420 #21 Twig\Template:display in /home/3/w/wallop/meny/wp-content/cache/gantry5/g5_helium-child/twig/33/33744c93dd728cf23806345542274850a03d221e0edfbc9fc961d559e456ef54.php:54 #20 __TwigTemplate_226380a3fe9f5212a785445a6e63272598972cc1fbe58bc065408df4f01e2f0b:block_content in /home/3/w/wallop/meny/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:214 #19 Twig\Template:displayBlock in /home/3/w/wallop/meny/wp-content/cache/gantry5/g5_helium-child/twig/78/786e87015ee2b00515e5378488abe3fcdbcaffde5a005b0f643ae562db8bbbda.php:55 #18 __TwigTemplate_90d820fcdcec3b95de4fab8d597cefcbaee49a3c303e1b9922f7c612ba62532c:doDisplay in /home/3/w/wallop/meny/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:453 #17 Twig\Template:displayWithErrorHandling in /home/3/w/wallop/meny/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:420 #16 Twig\Template:display in /home/3/w/wallop/meny/wp-content/cache/gantry5/g5_helium-child/twig/ab/ab2589e5ab62169abdb5bb64d8ab9f4018928b665ec36c01dd25c596ed276938.php:36 #15 __TwigTemplate_17ce8d5cfe52398aa05909139cb7a4e435e581eb2e432edcea2aa5b7caeadb3b:doDisplay in /home/3/w/wallop/meny/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:453 #14 Twig\Template:displayWithErrorHandling in /home/3/w/wallop/meny/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:420 #13 Twig\Template:display in /home/3/w/wallop/meny/wp-content/cache/gantry5/g5_helium-child/twig/33/33744c93dd728cf23806345542274850a03d221e0edfbc9fc961d559e456ef54.php:40 #12 __TwigTemplate_226380a3fe9f5212a785445a6e63272598972cc1fbe58bc065408df4f01e2f0b:doDisplay in /home/3/w/wallop/meny/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:453 #11 Twig\Template:displayWithErrorHandling in /home/3/w/wallop/meny/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:420 #10 Twig\Template:display in /home/3/w/wallop/meny/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:432 #9 Twig\Template:render in /home/3/w/wallop/meny/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/TemplateWrapper.php:47 #8 Twig\TemplateWrapper:render in /home/3/w/wallop/meny/wp-content/plugins/gantry5/vendor/timber/timber/lib/Loader.php:79 #7 Timber\Loader:render in /home/3/w/wallop/meny/wp-content/plugins/gantry5/vendor/timber/timber/lib/Timber.php:334 #6 Timber\Timber:compile in /home/3/w/wallop/meny/wp-content/plugins/gantry5/vendor/timber/timber/lib/Timber.php:383 #5 Timber\Timber:fetch in /home/3/w/wallop/meny/wp-content/plugins/gantry5/vendor/timber/timber/lib/Timber.php:410 #4 Timber\Timber:render in /home/3/w/wallop/meny/wp-content/themes/g5_helium/single.php:30 #3 require_once in /home/3/w/wallop/meny/wp-content/themes/g5_helium-child/single-restaurant.php:1 #2 include in /home/3/w/wallop/meny/wp-includes/template-loader.php:106 #1 require_once in /home/3/w/wallop/meny/wp-blog-header.php:19 #0 require in /home/3/w/wallop/meny/index.php:17
Stack frames (32)
31
Twig\Error\RuntimeError
/home/3/w/wallop/meny/wp-content/themes/g5_helium-child/views/partials/content-single.html.twig25
30
Whoops\Exception\ErrorException
/home/3/w/wallop/meny/wp-content/themes/g5_helium-child/functions.php86
29
Gantry\Component\Whoops\SystemFacade handleError
/home/3/w/wallop/meny/wp-content/themes/g5_helium-child/functions.php86
28
get_menyer_magic_info
/vendor/timber/timber/lib/Twig.php296
27
call_user_func_array
/vendor/timber/timber/lib/Twig.php296
26
Timber\Twig exec_function
/home/3/w/wallop/meny/wp-content/cache/gantry5/g5_helium-child/twig/95/9549c4fc25d7dd240ab3520596072c0219b933d2ebbd465cfa8732871a8861bc.php102
25
__TwigTemplate_b4883e13f3a806e6ffac844cd7ee517712166ee39d355e55794dd12a5456a57a block_content
/compat/vendor/twig/twig/src/Template.php214
24
Twig\Template displayBlock
/home/3/w/wallop/meny/wp-content/cache/gantry5/g5_helium-child/twig/95/9549c4fc25d7dd240ab3520596072c0219b933d2ebbd465cfa8732871a8861bc.php41
23
__TwigTemplate_b4883e13f3a806e6ffac844cd7ee517712166ee39d355e55794dd12a5456a57a doDisplay
/compat/vendor/twig/twig/src/Template.php453
22
Twig\Template displayWithErrorHandling
/compat/vendor/twig/twig/src/Template.php420
21
Twig\Template display
/home/3/w/wallop/meny/wp-content/cache/gantry5/g5_helium-child/twig/33/33744c93dd728cf23806345542274850a03d221e0edfbc9fc961d559e456ef54.php54
20
__TwigTemplate_226380a3fe9f5212a785445a6e63272598972cc1fbe58bc065408df4f01e2f0b block_content
/compat/vendor/twig/twig/src/Template.php214
19
Twig\Template displayBlock
/home/3/w/wallop/meny/wp-content/cache/gantry5/g5_helium-child/twig/78/786e87015ee2b00515e5378488abe3fcdbcaffde5a005b0f643ae562db8bbbda.php55
18
__TwigTemplate_90d820fcdcec3b95de4fab8d597cefcbaee49a3c303e1b9922f7c612ba62532c doDisplay
/compat/vendor/twig/twig/src/Template.php453
17
Twig\Template displayWithErrorHandling
/compat/vendor/twig/twig/src/Template.php420
16
Twig\Template display
/home/3/w/wallop/meny/wp-content/cache/gantry5/g5_helium-child/twig/ab/ab2589e5ab62169abdb5bb64d8ab9f4018928b665ec36c01dd25c596ed276938.php36
15
__TwigTemplate_17ce8d5cfe52398aa05909139cb7a4e435e581eb2e432edcea2aa5b7caeadb3b doDisplay
/compat/vendor/twig/twig/src/Template.php453
14
Twig\Template displayWithErrorHandling
/compat/vendor/twig/twig/src/Template.php420
13
Twig\Template display
/home/3/w/wallop/meny/wp-content/cache/gantry5/g5_helium-child/twig/33/33744c93dd728cf23806345542274850a03d221e0edfbc9fc961d559e456ef54.php40
12
__TwigTemplate_226380a3fe9f5212a785445a6e63272598972cc1fbe58bc065408df4f01e2f0b doDisplay
/compat/vendor/twig/twig/src/Template.php453
11
Twig\Template displayWithErrorHandling
/compat/vendor/twig/twig/src/Template.php420
10
Twig\Template display
/compat/vendor/twig/twig/src/Template.php432
9
Twig\Template render
/compat/vendor/twig/twig/src/TemplateWrapper.php47
8
Twig\TemplateWrapper render
/vendor/timber/timber/lib/Loader.php79
7
Timber\Loader render
/vendor/timber/timber/lib/Timber.php334
6
Timber\Timber compile
/vendor/timber/timber/lib/Timber.php383
5
Timber\Timber fetch
/vendor/timber/timber/lib/Timber.php410
4
Timber\Timber render
/home/3/w/wallop/meny/wp-content/themes/g5_helium/single.php30
3
require_once
/home/3/w/wallop/meny/wp-content/themes/g5_helium-child/single-restaurant.php1
2
include
/home/3/w/wallop/meny/wp-includes/template-loader.php106
1
require_once
/home/3/w/wallop/meny/wp-blog-header.php19
0
require
/home/3/w/wallop/meny/index.php17
        {# TODO: Check if restaurant has purchased licence #}
        {% if not function( 'post_password_required', post.ID ) %}
            
            <div class="restaurant-content-canvas">
                {# Begin Entry Content #}
                <section class="restaurant-content">

                    {% if gantry.config.get('content.' ~ scope ~ '.title.enabled', '1') %}
                        {# Begin Entry Title #}
                        <h2 class="entry-title">
                            {% if gantry.config.get('content.' ~ scope ~ '.title.link', '0') %}
                                <a href="{{ post.link }}" title="{{ post.title }}">{{ post.title }}</a>
                            {% else %}
                                {{ post.title }}
                            {% endif %}
                        </h2>
                        {# End Entry Title #}
                    {% endif %}

                    {{ function('get_menyer_magic_info') }}

                    {# Begin Entry Meta #}
                    {% if gantry.config.get('content.' ~ scope ~ '.meta-date.enabled', '1') or gantry.config.get('content.' ~ scope ~ '.meta-author.enabled', '1') or gantry.config.get('content.' ~ scope ~ '.meta-comments.enabled', '1') or gantry.config.get('content.' ~ scope ~ '.meta-categories.enabled', '1') or gantry.config.get('content.' ~ scope ~ '.meta-tags.enabled', '0') %}
                        {% include ['partials/meta-' ~ scope ~ '.html.twig', 'partials/meta.html.twig'] %}
                    {% endif %}
                    {# End Entry Meta #}
                    
                    {# Begin Featured Image #}
                    {% if gantry.config.get('content.' ~ scope ~ '.featured-image.enabled', '1') and post.thumbnail.src %}
                        {% set position = (gantry.config.get('content.' ~ scope ~ '.featured-image.position', 'none') == 'none') ? '' : 'float-' ~ gantry.config.get('content.' ~ scope ~ '.featured-image.position', 'none') %}
                        <a href="{{ post.link }}" class="post-thumbnail" aria-hidden="true">
                            <img src="{{ post.thumbnail.src|resize(gantry.config.get('content.' ~ scope ~ '.featured-image.width', '1200'), gantry.config.get('content.' ~ scope ~ '.featured-image.height', '350')) }}" class="featured-image tease-featured-image {{ position }}" alt="{{ post.title }}" />
                        </a>
                    {% endif %}
                    {# End Featured Image #}
                    
                    {# Begin Page Content #}
                    {{ post.paged_content|raw }}
                    
                    {{ function('wp_link_pages', {'before': '<div class="page-links" itemprop="pagination"><ul class="pagination-list">', 'after': '</ul></div>', 'link_before': '<span class="page-number page-numbers">', 'link_after': '</span>', 'echo': 0}) }}
    //}
    return $html;
}
function get_restaurant_editlink($postID){
    $html = '';
    if(is_user_logged_in()){
        $html = '<div class="menyer-edit"><a href="'.get_edit_post_link( $postID ).'" title="Rediger restaurant" class="restaurant-list-icon menu-editlink">Rediger</a></div>';
    }
    return $html;
}

function get_menyer_magic_info( ){
    $o = '';
    
    //displayArray($gmw['results']);
    $arr_rest_meta = gmw_get_post_location_meta();
    
    $o .= '<div class="menyer-magic-info">'.
        get_restaurant_menulink(get_the_ID()).
        get_restaurant_geo_my_wp_phone($arr_rest_meta['phone']).
        get_restaurant_editlink(get_the_ID()).'
        </div>';
        
    return $o;
}

function menyer_magic_info( $post, $gmw ){
    $o = '';
    
    //displayArray($gmw['results']);
    $arr_rest_meta = gmw_get_post_location_meta();
    //displayArray($arr_rest_meta);
    $phone = '';
    if(isset($arr_rest_meta['phone'])){$phone = $arr_rest_meta['phone'];}
    
    $o .= '<div class="menyer-magic-info">'.
        get_restaurant_menulink($post->ID).
        get_restaurant_geo_my_wp_phone($phone).
        get_restaurant_editlink($post->ID).
        '</div>';
Exception message: Undefined array key "phone"
    //}
    return $html;
}
function get_restaurant_editlink($postID){
    $html = '';
    if(is_user_logged_in()){
        $html = '<div class="menyer-edit"><a href="'.get_edit_post_link( $postID ).'" title="Rediger restaurant" class="restaurant-list-icon menu-editlink">Rediger</a></div>';
    }
    return $html;
}

function get_menyer_magic_info( ){
    $o = '';
    
    //displayArray($gmw['results']);
    $arr_rest_meta = gmw_get_post_location_meta();
    
    $o .= '<div class="menyer-magic-info">'.
        get_restaurant_menulink(get_the_ID()).
        get_restaurant_geo_my_wp_phone($arr_rest_meta['phone']).
        get_restaurant_editlink(get_the_ID()).'
        </div>';
        
    return $o;
}

function menyer_magic_info( $post, $gmw ){
    $o = '';
    
    //displayArray($gmw['results']);
    $arr_rest_meta = gmw_get_post_location_meta();
    //displayArray($arr_rest_meta);
    $phone = '';
    if(isset($arr_rest_meta['phone'])){$phone = $arr_rest_meta['phone'];}
    
    $o .= '<div class="menyer-magic-info">'.
        get_restaurant_menulink($post->ID).
        get_restaurant_geo_my_wp_phone($phone).
        get_restaurant_editlink($post->ID).
        '</div>';
        if ( is_array($arr) ) {
            return $arr;
        }
        $arr = array($arr);
        return $arr;
    }
 
    /**
     *
     *
     * @param string  $function_name
     * @return mixed
     */
    public function exec_function( $function_name ) {
        $args = func_get_args();
        array_shift($args);
        if ( is_string($function_name) ) {
            $function_name = trim($function_name);
        }
        return call_user_func_array($function_name, ($args));
    }
 
    /**
     *
     *
     * @param string  $content
     * @return string
     */
    public function twig_pretags( $content ) {
        return preg_replace_callback('|<pre.*>(.*)</pre|isU', array(&$this, 'convert_pre_entities'), $content);
    }
 
    /**
     *
     *
     * @param array   $matches
     * @return string
     */
    public function convert_pre_entities( $matches ) {
        return str_replace($matches[1], htmlentities($matches[1]), $matches[0]);
        if ( is_array($arr) ) {
            return $arr;
        }
        $arr = array($arr);
        return $arr;
    }
 
    /**
     *
     *
     * @param string  $function_name
     * @return mixed
     */
    public function exec_function( $function_name ) {
        $args = func_get_args();
        array_shift($args);
        if ( is_string($function_name) ) {
            $function_name = trim($function_name);
        }
        return call_user_func_array($function_name, ($args));
    }
 
    /**
     *
     *
     * @param string  $content
     * @return string
     */
    public function twig_pretags( $content ) {
        return preg_replace_callback('|<pre.*>(.*)</pre|isU', array(&$this, 'convert_pre_entities'), $content);
    }
 
    /**
     *
     *
     * @param array   $matches
     * @return string
     */
    public function convert_pre_entities( $matches ) {
        return str_replace($matches[1], htmlentities($matches[1]), $matches[0]);
                    echo "</a>
                            ";
                } else {
                    // line 19
                    echo "                                ";
                    echo $this->getAttribute(($context["post"] ?? null), "title", []);
                    echo "
                            ";
                }
                // line 21
                echo "                        </h2>
                        ";
                // line 23
                echo "                    ";
            }
            // line 24
            echo "
                    ";
            // line 25
            echo call_user_func_array($this->env->getFunction('function')->getCallable(), ["get_menyer_magic_info"]);
            echo "
 
                    ";
            // line 28
            echo "                    ";
            if ((((($this->getAttribute($this->getAttribute(($context["gantry"] ?? null), "config", []), "get", [0 => (("content." . ($context["scope"] ?? null)) . ".meta-date.enabled"), 1 => "1"], "method") || $this->getAttribute($this->getAttribute(($context["gantry"] ?? null), "config", []), "get", [0 => (("content." . ($context["scope"] ?? null)) . ".meta-author.enabled"), 1 => "1"], "method")) || $this->getAttribute($this->getAttribute(($context["gantry"] ?? null), "config", []), "get", [0 => (("content." . ($context["scope"] ?? null)) . ".meta-comments.enabled"), 1 => "1"], "method")) || $this->getAttribute($this->getAttribute(($context["gantry"] ?? null), "config", []), "get", [0 => (("content." . ($context["scope"] ?? null)) . ".meta-categories.enabled"), 1 => "1"], "method")) || $this->getAttribute($this->getAttribute(($context["gantry"] ?? null), "config", []), "get", [0 => (("content." . ($context["scope"] ?? null)) . ".meta-tags.enabled"), 1 => "0"], "method"))) {
                // line 29
                echo "                        ";
                $this->loadTemplate([0 => (("partials/meta-" . ($context["scope"] ?? null)) . ".html.twig"), 1 => "partials/meta.html.twig"], "partials/content-single.html.twig", 29)->display($context);
                // line 30
                echo "                    ";
            }
            // line 31
            echo "                    ";
            // line 32
            echo "                    
                    ";
            // line 34
            echo "                    ";
            if (($this->getAttribute($this->getAttribute(($context["gantry"] ?? null), "config", []), "get", [0 => (("content." . ($context["scope"] ?? null)) . ".featured-image.enabled"), 1 => "1"], "method") && $this->getAttribute($this->getAttribute(($context["post"] ?? null), "thumbnail", []), "src", []))) {
 
        if ($useBlocks && isset($blocks[$name])) {
            $template = $blocks[$name][0];
            $block = $blocks[$name][1];
        } elseif (isset($this->blocks[$name])) {
            $template = $this->blocks[$name][0];
            $block = $this->blocks[$name][1];
        } else {
            $template = null;
            $block = null;
        }
 
        // avoid RCEs when sandbox is enabled
        if (null !== $template && !$template instanceof self) {
            throw new \LogicException('A block must be a method on a \Twig\Template instance.');
        }
 
        if (null !== $template) {
            try {
                $template->$block($context, $blocks);
            } catch (Error $e) {
                if (!$e->getSourceContext()) {
                    $e->setSourceContext($template->getSourceContext());
                }
 
                // this is mostly useful for \Twig\Error\LoaderError exceptions
                // see \Twig\Error\LoaderError
                if (-1 === $e->getTemplateLine()) {
                    $e->guess();
                }
 
                throw $e;
            } catch (\Exception $e) {
                $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $template->getSourceContext(), $e);
                $e->guess();
 
                throw $e;
            }
        } elseif (false !== $parent = $this->getParent($context)) {
            $parent->displayBlock($name, $context, array_merge($this->blocks, $blocks), false);
 
        $this->blocks = [
            'content' => [$this, 'block_content'],
        ];
    }
 
    protected function doDisplay(array $context, array $blocks = [])
    {
        // line 1
        echo "<article class=\"post-type-";
        echo $this->getAttribute(($context["post"] ?? null), "post_type", []);
        echo " ";
        echo $this->getAttribute(($context["post"] ?? null), "class", []);
        echo "\" id=\"post-";
        echo $this->getAttribute(($context["post"] ?? null), "ID", []);
        echo "\">
 
    ";
        // line 3
        $this->displayBlock('content', $context, $blocks);
        // line 73
        echo "
</article>
";
    }
 
    // line 3
    public function block_content($context, array $blocks = [])
    {
        // line 4
        echo "
        ";
        // line 6
        echo "        ";
        // line 7
        echo "        ";
        if ( !call_user_func_array($this->env->getFunction('function')->getCallable(), ["post_password_required", $this->getAttribute(($context["post"] ?? null), "ID", [])])) {
            // line 8
            echo "            
            <div class=\"restaurant-content-canvas\">
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
            $this->doDisplay($context, $blocks);
        } catch (Error $e) {
            if (!$e->getSourceContext()) {
                $e->setSourceContext($this->getSourceContext());
            }
 
            // this is mostly useful for \Twig\Error\LoaderError exceptions
            // see \Twig\Error\LoaderError
            if (-1 === $e->getTemplateLine()) {
                $e->guess();
            }
 
            throw $e;
        } catch (\Exception $e) {
            $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
            $e->guess();
 
            throw $e;
        }
    }
 
    {
        return $this;
    }
 
    /**
     * Returns all blocks.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @return array An array of blocks
     */
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
        $context["twigTemplate"] = "single.html.twig";
        // line 3
        $context["scope"] = "single";
        // line 1
        $this->parent = $this->loadTemplate("partials/page.html.twig", "single.html.twig", 1);
        $this->parent->display($context, array_merge($this->blocks, $blocks));
    }
 
    // line 5
    public function block_content($context, array $blocks = [])
    {
        // line 6
        echo "
    <div class=\"platform-content\">
        <div class=\"content-wrapper\">
            <section class=\"entry\">
 
                ";
        // line 11
        $this->loadTemplate([0 => (("partials/content-" . ($context["scope"] ?? null)) . ".html.twig"), 1 => "partials/content.html.twig"], "single.html.twig", 11)->display($context);
        // line 12
        echo "
            </section>
        </div> <!-- /content-wrapper -->
    </div>
 
";
    }
 
    public function getTemplateName()
    {
        return "single.html.twig";
    }
 
    public function isTraitable()
    {
        return false;
    }
 
    public function getDebugInfo()
 
        if ($useBlocks && isset($blocks[$name])) {
            $template = $blocks[$name][0];
            $block = $blocks[$name][1];
        } elseif (isset($this->blocks[$name])) {
            $template = $this->blocks[$name][0];
            $block = $this->blocks[$name][1];
        } else {
            $template = null;
            $block = null;
        }
 
        // avoid RCEs when sandbox is enabled
        if (null !== $template && !$template instanceof self) {
            throw new \LogicException('A block must be a method on a \Twig\Template instance.');
        }
 
        if (null !== $template) {
            try {
                $template->$block($context, $blocks);
            } catch (Error $e) {
                if (!$e->getSourceContext()) {
                    $e->setSourceContext($template->getSourceContext());
                }
 
                // this is mostly useful for \Twig\Error\LoaderError exceptions
                // see \Twig\Error\LoaderError
                if (-1 === $e->getTemplateLine()) {
                    $e->guess();
                }
 
                throw $e;
            } catch (\Exception $e) {
                $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $template->getSourceContext(), $e);
                $e->guess();
 
                throw $e;
            }
        } elseif (false !== $parent = $this->getParent($context)) {
            $parent->displayBlock($name, $context, array_merge($this->blocks, $blocks), false);
    }
 
    protected function doDisplay(array $context, array $blocks = [])
    {
        // line 1
        $this->getAttribute($this->getAttribute(($context["gantry"] ?? null), "debugger", []), "startTimer", [0 => "render", 1 => "Rendering page"], "method");
        // line 2
        $this->getAttribute($this->getAttribute(($context["gantry"] ?? null), "theme", []), "setLayout", [], "method");
        // line 3
        $this->getAttribute($this->getAttribute(($context["gantry"] ?? null), "theme", []), "loadAtoms", [], "method");
        // line 4
        $context["segments"] = $this->getAttribute($this->getAttribute(($context["gantry"] ?? null), "theme", []), "segments", [], "method");
        // line 6
        ob_start(function () { return ''; });
        // line 7
        echo "    ";
        if ($this->getAttribute($this->getAttribute(($context["gantry"] ?? null), "theme", []), "hasContent", [], "method")) {
            // line 8
            echo "        ";
            $this->displayBlock('content', $context, $blocks);
            // line 10
            echo "    ";
        }
        $context["content"] = ('' === $tmp = ob_get_clean()) ? '' : new Markup($tmp, $this->env->getCharset());
        // line 13
        $context["offcanvas"] = null;
        // line 14
        $context['_parent'] = $context;
        $context['_seq'] = twig_ensure_traversable(($context["segments"] ?? null));
        foreach ($context['_seq'] as $context["_key"] => $context["segment"]) {
            // line 15
            echo "    ";
            if (($this->getAttribute($context["segment"], "type", []) == "offcanvas")) {
                // line 16
                $context["offcanvas"] = $context["segment"];
            }
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['segment'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
            $this->doDisplay($context, $blocks);
        } catch (Error $e) {
            if (!$e->getSourceContext()) {
                $e->setSourceContext($this->getSourceContext());
            }
 
            // this is mostly useful for \Twig\Error\LoaderError exceptions
            // see \Twig\Error\LoaderError
            if (-1 === $e->getTemplateLine()) {
                $e->guess();
            }
 
            throw $e;
        } catch (\Exception $e) {
            $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
            $e->guess();
 
            throw $e;
        }
    }
 
    {
        return $this;
    }
 
    /**
     * Returns all blocks.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @return array An array of blocks
     */
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
    public function __construct(Environment $env)
    {
        parent::__construct($env);
 
        $this->blocks = [
            'page_head' => [$this, 'block_page_head'],
            'page_footer' => [$this, 'block_page_footer'],
        ];
    }
 
    protected function doGetParent(array $context)
    {
        // line 1
        return "@nucleus/page.html.twig";
    }
 
    protected function doDisplay(array $context, array $blocks = [])
    {
        $this->parent = $this->loadTemplate("@nucleus/page.html.twig", "partials/page.html.twig", 1);
        $this->parent->display($context, array_merge($this->blocks, $blocks));
    }
 
    // line 3
    public function block_page_head($context, array $blocks = [])
    {
        // line 4
        if (($context["page_head"] ?? null)) {
            // line 5
            echo "        ";
            echo ($context["page_head"] ?? null);
            echo "
    ";
        } else {
            // line 7
            echo "        ";
            $this->displayParentBlock("page_head", $context, $blocks);
            echo "
    ";
        }
    }
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
            $this->doDisplay($context, $blocks);
        } catch (Error $e) {
            if (!$e->getSourceContext()) {
                $e->setSourceContext($this->getSourceContext());
            }
 
            // this is mostly useful for \Twig\Error\LoaderError exceptions
            // see \Twig\Error\LoaderError
            if (-1 === $e->getTemplateLine()) {
                $e->guess();
            }
 
            throw $e;
        } catch (\Exception $e) {
            $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
            $e->guess();
 
            throw $e;
        }
    }
 
    {
        return $this;
    }
 
    /**
     * Returns all blocks.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @return array An array of blocks
     */
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
        $this->blocks = [
            'content' => [$this, 'block_content'],
        ];
    }
 
    protected function doGetParent(array $context)
    {
        // line 1
        return "partials/page.html.twig";
    }
 
    protected function doDisplay(array $context, array $blocks = [])
    {
        // line 2
        $context["twigTemplate"] = "single.html.twig";
        // line 3
        $context["scope"] = "single";
        // line 1
        $this->parent = $this->loadTemplate("partials/page.html.twig", "single.html.twig", 1);
        $this->parent->display($context, array_merge($this->blocks, $blocks));
    }
 
    // line 5
    public function block_content($context, array $blocks = [])
    {
        // line 6
        echo "
    <div class=\"platform-content\">
        <div class=\"content-wrapper\">
            <section class=\"entry\">
 
                ";
        // line 11
        $this->loadTemplate([0 => (("partials/content-" . ($context["scope"] ?? null)) . ".html.twig"), 1 => "partials/content.html.twig"], "single.html.twig", 11)->display($context);
        // line 12
        echo "
            </section>
        </div> <!-- /content-wrapper -->
    </div>
 
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
            $this->doDisplay($context, $blocks);
        } catch (Error $e) {
            if (!$e->getSourceContext()) {
                $e->setSourceContext($this->getSourceContext());
            }
 
            // this is mostly useful for \Twig\Error\LoaderError exceptions
            // see \Twig\Error\LoaderError
            if (-1 === $e->getTemplateLine()) {
                $e->guess();
            }
 
            throw $e;
        } catch (\Exception $e) {
            $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
            $e->guess();
 
            throw $e;
        }
    }
 
    {
        return $this;
    }
 
    /**
     * Returns all blocks.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @return array An array of blocks
     */
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
     * @internal
     */
    public function __construct(Environment $env, Template $template)
    {
        $this->env = $env;
        $this->template = $template;
    }
 
    /**
     * Renders the template.
     *
     * @param array $context An array of parameters to pass to the template
     *
     * @return string The rendered template
     */
    public function render($context = [])
    {
        // using func_get_args() allows to not expose the blocks argument
        // as it should only be used by internal code
        return $this->template->render($context, \func_num_args() > 1 ? func_get_arg(1) : []);
    }
 
    /**
     * Displays the template.
     *
     * @param array $context An array of parameters to pass to the template
     */
    public function display($context = [])
    {
        // using func_get_args() allows to not expose the blocks argument
        // as it should only be used by internal code
        $this->template->display($context, \func_num_args() > 1 ? func_get_arg(1) : []);
    }
 
    /**
     * Checks if a block is defined.
     *
     * @param string $name    The block name
     * @param array  $context An array of parameters to pass to the template
     *
 
        $key = null;
        $output = false;
        if ( false !== $expires ) {
            ksort($data);
            $key = md5($file.json_encode($data));
            $output = $this->get_cache($key, self::CACHEGROUP, $cache_mode);
        }
 
        if ( false === $output || null === $output ) {
            $twig = $this->get_twig();
            if ( strlen($file) ) {
                $loader = $this->get_loader();
                $result = $loader->getCacheKey($file);
                do_action('timber_loader_render_file', $result);
            }
            $data = apply_filters('timber_loader_render_data', $data);
            $data = apply_filters('timber/loader/render_data', $data, $file);
            $template = $twig->load($file);
            $output = $template->render($data);
        }
 
        if ( false !== $output && false !== $expires && null !== $key ) {
            $this->delete_cache();
            $this->set_cache($key, $output, self::CACHEGROUP, $expires, $cache_mode);
        }
        $output = apply_filters('timber_output', $output);
        return apply_filters('timber/output', $output, $data, $file);
    }
 
    protected function delete_cache() {
        Cleaner::delete_transients();
    }
 
    /**
     * Get first existing template.
     *
     * @param array|string $templates  Name(s) of the Twig template(s) to choose from.
     * @return string|bool             Name of chosen template, otherwise false.
     */
        if ( $via_render ) {
            $file = apply_filters('timber_render_file', $file);
        } else {
            $file = apply_filters('timber_compile_file', $file);
        }
 
        $output = false;
 
        if ($file !== false) {
            if ( is_null($data) ) {
                $data = array();
            }
 
            if ( $via_render ) {
                $data = apply_filters('timber_render_data', $data);
            } else {
                $data = apply_filters('timber_compile_data', $data);
            }
 
            $output = $loader->render($file, $data, $expires, $cache_mode);
        } else {
            if ( is_array($filenames) ) {
                $filenames = implode(", ", $filenames);
            }
            Helper::error_log( 'Error loading your template files: '.$filenames.'. Make sure one of these files exists.' );
        }
 
        do_action('timber_compile_done');
        return $output;
    }
 
    /**
     * Compile a string.
     *
     * @api
     * @example
     * ```php
     * $data = array(
     *     'username' => 'Jane Doe',
     * );
        $twig = $dummy_loader->get_twig();
        $template = $twig->createTemplate($string);
        return $template->render($data);
    }
 
    /**
     * Fetch function.
     *
     * @api
     * @param array|string $filenames  Name of the Twig file to render. If this is an array of files, Timber will
     *                                 render the first file that exists.
     * @param array        $data       Optional. An array of data to use in Twig template.
     * @param bool|int     $expires    Optional. In seconds. Use false to disable cache altogether. When passed an
     *                                 array, the first value is used for non-logged in visitors, the second for users.
     *                                 Default false.
     * @param string       $cache_mode Optional. Any of the cache mode constants defined in TimberLoader.
     * @return bool|string The returned output.
     */
    public static function fetch( $filenames, $data = array(), $expires = false, $cache_mode = Loader::CACHE_USE_DEFAULT ) {
        $output = self::compile($filenames, $data, $expires, $cache_mode, true);
        $output = apply_filters('timber_compile_result', $output);
        return $output;
    }
 
    /**
     * Render function.
     *
     * Passes data to a Twig file and echoes the output.
     *
     * @api
     * @example
     * ```php
     * $context = Timber::context();
     *
     * Timber::render( 'index.twig', $context );
     * ```
     * @param array|string $filenames  Name of the Twig file to render. If this is an array of files, Timber will
     *                                 render the first file that exists.
     * @param array        $data       Optional. An array of data to use in Twig template.
     * @param bool|int     $expires    Optional. In seconds. Use false to disable cache altogether. When passed an
     * Passes data to a Twig file and echoes the output.
     *
     * @api
     * @example
     * ```php
     * $context = Timber::context();
     *
     * Timber::render( 'index.twig', $context );
     * ```
     * @param array|string $filenames  Name of the Twig file to render. If this is an array of files, Timber will
     *                                 render the first file that exists.
     * @param array        $data       Optional. An array of data to use in Twig template.
     * @param bool|int     $expires    Optional. In seconds. Use false to disable cache altogether. When passed an
     *                                 array, the first value is used for non-logged in visitors, the second for users.
     *                                 Default false.
     * @param string       $cache_mode Optional. Any of the cache mode constants defined in TimberLoader.
     * @return bool|string The echoed output.
     */
    public static function render( $filenames, $data = array(), $expires = false, $cache_mode = Loader::CACHE_USE_DEFAULT ) {
        $output = self::fetch($filenames, $data, $expires, $cache_mode);
        echo $output;
        return $output;
    }
 
    /**
     * Render a string with Twig variables.
     *
     * @api
     * @example
     * ```php
     * $data = array(
     *     'username' => 'Jane Doe',
     * );
     *
     * Timber::render_string( 'Hi {{ username }}, I’m a string with a custom Twig variable', $data );
     * ```
     * @param string $string A string with Twig variables.
     * @param array  $data   An array of data to use in Twig template.
     * @return bool|string
     */
defined('ABSPATH') or die;
 
use Timber\Timber;
 
/*
 * The Template for displaying all single posts
 */
 
$gantry = Gantry\Framework\Gantry::instance();
$theme  = $gantry['theme'];
 
// We need to render contents of <head> before plugin content gets added.
$context              = Timber::get_context();
$context['page_head'] = $theme->render('partials/page_head.html.twig', $context);
 
$post            = Timber::query_post();
$context['post'] = $post;
$context['wp_title'] .= ' - ' . $post->title();
 
Timber::render(['single-' . $post->ID . '.html.twig', 'single-' . $post->post_type . '.html.twig', 'single.html.twig'], $context);
 
<?php require_once(get_parent_theme_file_path().'/single.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;
}
 
<?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 Apache/2.4.41
REQUEST_URI /restaurant/tunco-oslo-street-food/
PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
NOTIFY_SOCKET /run/systemd/notify
LISTEN_FDNAMES uwsgi-wallop.socket
HOME /home/3/w/wallop
LOGNAME wallop
USER wallop
INVOCATION_ID 8b1f599632c34ffd87b0ebba861dc294
JOURNAL_STREAM 9:315081
RUNTIME_DIRECTORY /run/uwsgi/wallop
LOGS_DIRECTORY /var/log/user/wallop
REDIRECT_UNIQUE_ID ZgZp3PpP6JVAMmqkVWmz0AAAADA
REDIRECT_HTTP_AUTHORIZATION
REDIRECT_HTTPS on
REDIRECT_STATUS 200
UNIQUE_ID ZgZp3PpP6JVAMmqkVWmz0AAAADA
HTTP_AUTHORIZATION
HTTPS on
proxy-nokeepalive 1
HTTP_HOST menyer.no
HTTP_CONNECTION close
HTTP_ACCEPT */*
HTTP_USER_AGENT claudebot
SERVER_SIGNATURE
SERVER_NAME menyer.no
SERVER_ADDR 194.63.248.117
SERVER_PORT 443
REMOTE_ADDR 34.207.178.236
DOCUMENT_ROOT /home/3/w/wallop/meny
REQUEST_SCHEME https
CONTEXT_PREFIX
CONTEXT_DOCUMENT_ROOT /home/3/w/wallop/meny
SERVER_ADMIN n/a
SCRIPT_FILENAME /home/3/w/wallop/meny/index.php
REMOTE_PORT 38856
REDIRECT_URL /restaurant/tunco-oslo-street-food/
GATEWAY_INTERFACE CGI/1.1
SERVER_PROTOCOL HTTP/1.0
REQUEST_METHOD GET
QUERY_STRING
SCRIPT_NAME /index.php
PATH_INFO
PATH_TRANSLATED /home/3/w/wallop/meny/index.php
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1711696348.7563
REQUEST_TIME 1711696348
empty
0. Whoops\Handler\PrettyPageHandler