skip to Main Content

I’m using the Timber plugin with Underscores.me template (https://github.com/timber/starter-theme) to create a website.

I used the Yoast and SEO Framework plugin and both create an issue!
When I add a description in the meta of a page, Timber doesn’t work anymore. There is no error message. But content is empty.

I have:
WordPress 4.9.2
Timber Version 1.6.0
The SEO Framework Version 3.0.3

Do you have an idea why?

2

Answers


  1. Chosen as BEST ANSWER

    I tried to uninstall all the plugins one by one. Apparently, the problem does not come from another plugin.

    I think the problem comes from the theme itself.

    I also noticed that the template "html-header.twig" contained meta fields for the title and the description. However, when an SEO plugin is activated, these metas remain in the source code. What creates a duplicate ...

    Also, after installing the debug bar, I do not see any errors. The situation is very strange. Because once a description of the page is introduced in the SEO plugin, Twig queries are empty ...

    I do not know if there is an error in my twig queries. Here they are:

    Page digital.php

    <?php
    
    $context = Timber::get_context();
    
    $args = array(
        // Get post type project
        'post_type' => 'project',
        // Get all posts
        'posts_per_page' => -1,
        // Gest post by "digital" category
        'meta_query' => array(
            array(
                'key' => 'project_category',
                'value' => 'digital',
                'compare' => 'LIKE'
            )
        ),
        // Order by post date
        'orderby' => array(
            'date' => 'DESC'
        ),
    );
    
    $context['digitals'] = Timber::get_posts( $args );
    
    Timber::render( 'page-digital.twig', $context );
    

    Page digital.twig

                    {% for post in digitals %}
                        {% if post.thumbnail %}
                            <a href="{{post.link}}" class="l-basicgrid-work work">
                                <article>
                                    <figure>
                                        <img data-src="{{post.get_thumbnail.src('medium_large')|resize(800, 533)}}" alt="{{post.title}}" class="lazy">
                                    </figure>
                                    <figcaption>
                                        <h2>{{ post.title }}</h2>
                                    </figcaption>
                                </article>
                            </a>
                        {% endif %}
                    {% endfor %} 
    

    Did I do something wrong?


  2. Why would you run another SEO plugin, next to Yoast ? What does it offer that Yoast can’t ?

    I run Yoast SEO and Timber on all my sites without issues and I never experienced anything it couldn’t handle.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search