
Basic information about this course:
Who is this course for?
Why would you use Twig & Timber?
List of contents
Course project - website
Additional information
How Timber and Twig work in Wordpress environment. Explanation based on templating example.
Process of creating new Wordpress installation with Twig and Timber environment to encourage you to join this course. All the steps are going to be explain in next chapters.
Install Local by Flywheel and create new website.
Install Visual Studio Code and extension that helps developing in Twig.
Install Composer to later use it for Timber installation.
Basic information about Twig and Timber and where you should search for information about it.
What is a variable and how to output it.
Understand data types, in first part you will learn about string, number, boolean and null.
Understand data types, in second part you will learn about array and hash.
Understand basics of template inheritance - one of the best Twig features, using tags block, extends and parent function
Conditional logic with if tag, execute some code based on some condition.
Different syntax for conditional logic - ternary operator - that you can use instead of if block.
Introduction to for loop that is used to run the same code multiple times, to iterate in a sequence of items.
More information and different usage of for loop.
Reusable pieces of code are another thing about templating in twig. Learn how to do it with macro and include.
More information about macro, how to set default values, call macro from the same file and special variable varargs.
Quick example to practice templating and visualize the rendering process.
Learn how to modify the variable before outputting to the HTML.
Learn how to use functions with some examples.
Explanation about available operators (logic, math, is, in) and how to perform a test.
Understand what is a truthy and falsy value in comparison to true and false.
HTML and Twig comments compared and also how to use dump function for debugging.
How to install Timber and how it connects Twig and WordPress. Also about two template hierarchies used in this environment to render initial .twig file.
Examples of data that you can grab from the context using post. site. and theme.
Learn how to add your own variables to the context in controller file (local) and also in functions (global). Also about using Advanced Custom Fields to send data from WP backend to the .twig template.
Few examples of different Timber features to give you an idea of how many things Timber has to offer.
How to install and use Timber Starter Theme as great starting point for you project.
Explore building a small local news site using WordPress, Timber, and Twig, with step-by-step configuration, data import, and responsive design tips, plus variations and assignments.
Configure a WordPress development environment from scratch, install WordPress locally, set up a Timber theme with Twig templates, and manage dependencies with Composer.
Prepare and import site data for a WordPress theme, using resources, databases, and images to build pages and custom post types like news, people, and places with featured images.
Create a breaking news feature in a WordPress theme by using the Advanced Custom Fields plugin, adding a post field, and applying conditional Twig styling.
Activate category and tag links in archive templates using Timber and Twig, rendering term-specific item lists with reusable includes and dedicated archive twig files for each category or tag.
Learn to display and highlight WordPress post categories and tags in a single item view using Twig and Timber, with options to use block, macro, or include.
Develop a WordPress page template with Twig and Timber to list all person posts from a custom post type, displaying thumbnail, name, and an excerpt with links to profiles.
Create a WordPress person post template with Twig and Timber to display a person's image, content, and name in a Bootstrap two-column layout, with favorite places via a relationship field.
Demonstrates a reverse query in WordPress, fetching all people (post type: person), filtering by each place in their favorite places, and displaying linked thumbnails with resize.
In this lesson we are going to learn what you should remember before deploying website and how to do it.
In this lesson we are going to create more complicated macro example.
Learn to build a WordPress theme options page with ACF Pro or a free version workaround, expose options to Twig templates, and update site values from the backend.
In this lesson we are going to learn what is Bootimber theme, how you can use it to develop in a more efficient way.
Important: Course has been updated in July 2020. Chapter 3 and 4 are live with more information and also increased font size.
--------------------------
Default WordPress templating system has some weaknesses. I will show you how to use Twig and Timber to create themes with modern approach where template is separated from the controller, templates are clean and readable just like in HTML with some extra features.
You will learn basics about Twig and Timber and how to use it in WordPress. As the project we are going to create a website from scratch using this environment. PHP and Bootstrap knowledge is useful bot not required. The only requirement is basic knowledge about HTML and CSS to understand the code.
Additional information:
This course is more like an introduction, we are going to stay near the beginner level for most of the time. It is not a full guide covering all features of Twig or Timber.