Some time ago I wrote the official Timber Documentation on ACF Blocks. Now I’ll show you how to do it in a much easier manner.

Preparations

Before we start we need to do two things:

  1. Install Timber ACF WP Blocks library
  2. Create a views/blocks folder in your theme

The best way to install the mentioned library is of course via Composer.

In case you don’t like the views/blocks folder you can change it by using timber/acf-gutenberg-blocks-templates filter.

Time to create a block

In our views/blocks folder we create a twig file (in this example — owl-link.twig) and on top of it, we add some additional comments…


Today there won’t be any code — just a short story about how we can help others.

A story of one task — “Add a shortcode”

It all began with one task — I had to add one shortcode for a service I was developing. Nothing less, nothing more. After I finished it I thought that maybe I’ll add the OEmbed functionality, so the blog authors could insert content in an easier manner.

After doing it I thought that I have a nice material for a plugin (especially that 360player.io …


More than a year ago — Timber has become one of the basic tools I use in every WordPress based project. Here I’ll try to show you why.

Timber — what is it?

The most basic definition would be that it’s just Twig for WordPress. But that’s not entirely true. Timber also adds many cool features like integrations with plugins (ACF, co-authors or WooCommerce) and filters for easy image resizing and manipulation.

At this moment it’s available as plugin or library, but soon we’ll drop the plugin support.

It brings order to your code

When you use Timber you have to separate logic from the view. …

Maciej Palmowski

I’m a WordPress developer, Timber Collaborator and GitKrakken Ambasador.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store