timber / starter-theme

The "_s" for Timber: a dead-simple theme that you can build anything from
MIT License
812 stars 274 forks source link

need a little modification in the single.php file. #86

Closed LeCanardNoir closed 8 months ago

LeCanardNoir commented 4 years ago

I add just one line to get this tutorial working in the single.php file.

This is the tutorial part:

{% extends "single.twig" %}

{% block headline %}
    <h1><img src="/wp-content/uploads/2014/05/jareds-face.jpg" alt="Jared’s Mug"/></h1>
{% endblock %}

That the line i need to add in the single.php file:

'single-' . $timber_post->slug . '.twig',

In this part of single.php file:

Timber::render(
        array(
            'single-' . $timber_post->ID . '.twig',
                'single-' . $timber_post->post_type . '.twig',
                'single-' . $timber_post->slug . '.twig',
                'single.twig'
        ),

I post this just to help any body with that tutorial, because this librairy "TIMBER" is awesome, thank good work.

jarednova commented 4 years ago

Thanks @LeCanardNoir — really glad to hear you've been able to use Timber successfully! Do you want to submit this as a PR? That way, your name will live in GitHub contributor infamy!