-2

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?

filnug
  • 191
  • 1
  • 2
  • 13

2 Answers2

0

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?

filnug
  • 191
  • 1
  • 2
  • 13
0

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.

Beee
  • 151
  • 8
  • My goal is to use one SEO plugin: Yoast or another (but not two plugins). I guess that I have a problem on my template that is causing this problem with all SEO plugin I have tested. I saw that I canceled the footer... and I put again. But It didn't change. I guess there is element that are needed on the template – filnug Feb 07 '18 at 09:03