We may earn an affiliate commission when you visit our partners.
Course image
Tomek Lecki

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.

Read more

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.

Enroll now

What's inside

Learning objectives

  • Wordpress theme development
  • Twig and timber

Syllabus

Understand how this system works.

Basic information about this course:

  • Who is this course for?

  • Why would you use Twig & Timber?

  • List of contents

  • Course project - website

  • Additional information

Read more

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.

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.

In this lesson we are going to learn what is Bootimber theme, how you can use it to develop in a more efficient way.

Traffic lights

Read about what's good
what should give you pause
and possible dealbreakers
Uses Twig and Timber, which enables developers to create WordPress themes with a modern approach, separating templates from controllers for cleaner and more readable code
Requires basic knowledge of HTML and CSS, which are fundamental skills for front-end development and customizing WordPress themes
Uses Local by Flywheel, Visual Studio Code, and Composer, which are standard tools in modern web development workflows
Covers template inheritance, conditional logic, loops, macros, includes, filters, functions, operators, and debugging, which are essential for dynamic content generation
Teaches how to use Advanced Custom Fields (ACF) to send data from the WordPress backend to Twig templates, which is useful for creating dynamic and customizable websites
Uses Bootstrap, which is a popular CSS framework, but learners should note that there are newer frameworks available that may offer more modern features

Save this course

Create your own learning path. Save this course to your list so you can find it easily later.
Save

Reviews summary

Twig and timber for modern wordpress themes

According to learners, this course offers a clear and concise introduction to developing WordPress themes using Twig and Timber, a method praised for its ability to create a more modern and maintainable workflow. Students particularly highlight the effectiveness of the project-based learning approach, where they build a website from scratch, finding the hands-on experience invaluable for solidifying their understanding. The instructor's explanations are generally considered clear and easy to follow, making the course accessible even for those relatively new to theme development. While widely seen as a great starting point and foundation, some reviewers note that the course stays near the beginner level and does not delve into more advanced topics or complex real-world scenarios, suggesting the need for supplemental resources for true mastery.
Good start, but lacks depth for advanced topics.
"My only minor criticism is that it could go a bit deeper into more advanced topics or troubleshooting common issues."
"Good as a first look, but you'll need other resources to truly master Timber/Twig."
"It doesn't go into extreme detail, but it sets you up well to explore further on your own."
"While it covers the very basics, it feels incomplete. It doesn't cover common real-world scenarios..."
Recent reviews suggest improvements over time.
"Excellent course! It provides a clear and concise introduction..."
"Fantastic course! Changed the way I approach WordPress theme development..."
"Brilliant introduction..."
"Outdated code and confusing explanations. The setup was difficult and didn't work as shown."
Introduces a better way to build WP themes.
"Excellent course! It provides a clear and concise introduction to using Twig and Timber with WordPress."
"Changed the way I approach WordPress theme development. Twig and Timber make such a difference..."
"Highly recommended for WP developers looking to adopt a modern workflow."
"Twig and Timber are game-changers, and this course teaches you how to use them effectively..."
Concepts are explained well and easy to follow.
"The instructor explains concepts well and the project-based learning is very effective."
"Very clear and easy to follow, even if you're relatively new to theme development."
"The instructor's explanations are clear and the pace is just right for beginners."
"Very clear instruction."
Builds a full website, reinforcing concepts.
"The project-based learning is very effective. Highly recommended for anyone wanting to modernize their WP theme development."
"The hands-on project building a website is great. My only minor criticism is that it could go a bit deeper..."
"Brilliant introduction. The focus on practical application through building a site is perfect."
"The project is well-structured and helps reinforce the concepts."
Further learning required for full understanding.
"Good as a first look, but you'll need other resources to truly master Timber/Twig."
"It doesn't go into extreme detail, but it sets you up well to explore further on your own. Good starting point."
"Had to look up a lot of things elsewhere."

Activities

Be better prepared before your course. Deepen your understanding during and after it. Supplement your coursework and achieve mastery of the topics covered in Wordpress Theme Development with Twig and Timber with these activities:
Review HTML and CSS Fundamentals
Strengthen your understanding of HTML and CSS, as this course assumes a basic knowledge of these technologies.
Show steps
  • Review basic HTML tags and attributes.
  • Practice creating simple web layouts with CSS.
  • Familiarize yourself with CSS selectors and properties.
Review: 'WordPress Theme Development Beginner's Guide'
Solidify your understanding of WordPress theme development fundamentals before diving into Twig and Timber.
Show steps
  • Read the book's introduction to WordPress theming.
  • Follow along with the book's examples to create a basic theme.
  • Identify areas where Twig and Timber can improve the theme development process.
Twig Templating Exercises
Practice using Twig syntax and features to reinforce your understanding of templating concepts.
Show steps
  • Find online Twig tutorials and exercises.
  • Create simple Twig templates to display data.
  • Experiment with Twig's control structures and filters.
  • Practice using template inheritance with Twig.
Four other activities
Expand to see all activities and additional details
Show all seven activities
Convert a Basic WordPress Theme to Twig and Timber
Apply your knowledge of Twig and Timber by converting an existing WordPress theme to use these technologies.
Show steps
  • Choose a simple WordPress theme to convert.
  • Set up a local WordPress environment with Twig and Timber.
  • Replace the theme's PHP templates with Twig templates.
  • Use Timber to pass data from WordPress to the Twig templates.
Blog Post: Twig vs. Traditional PHP Templating in WordPress
Solidify your understanding by explaining the benefits of using Twig and Timber for WordPress theme development.
Show steps
  • Research the advantages and disadvantages of Twig and Timber.
  • Outline the key points you want to cover in your blog post.
  • Write a clear and concise blog post explaining the benefits of Twig and Timber.
  • Include code examples to illustrate your points.
Review: 'Professional WordPress Plugin Development'
Expand your knowledge of the WordPress ecosystem by exploring plugin development.
Show steps
  • Read the book's introduction to WordPress plugin development.
  • Explore the book's examples of common plugin functionalities.
  • Consider how plugins can be used to enhance your Twig and Timber themes.
Contribute to a Timber-Based Theme
Gain practical experience and contribute to the WordPress community by contributing to an open-source Timber-based theme.
Show steps
  • Find an open-source WordPress theme that uses Timber.
  • Review the theme's code and identify areas for improvement.
  • Contribute bug fixes, new features, or documentation to the theme.
  • Submit your changes to the theme's maintainers for review.

Career center

Learners who complete Wordpress Theme Development with Twig and Timber will develop knowledge and skills that may be useful to these careers:
WordPress Developer
A WordPress Developer designs and implements websites using the WordPress content management system. This course focuses on using Twig and Timber to create WordPress themes, offering a modern approach by separating the template from the controller. A WordPress Developer should take this course because it helps you create clean and readable templates. This course also helps you develop a website from scratch using this environment. Learning the basics of Twig and Timber can greatly enhance a developer's ability to create efficient and maintainable WordPress themes.
Theme Developer
A Theme Developer creates visual themes and templates for websites and applications. This course helps theme developers learn to use Twig and Timber within the WordPress environment. It helps one separate template logic from presentation. The course's hands-on project of building a website from scratch provides practical experience in theme development. This course helps theme developers adopt a modern approach to WordPress theme creation, resulting in more maintainable and scalable projects.
Wordpress Engineer
A WordPress Engineer designs, develops, and maintains WordPress websites and applications. This course is directly relevant to a WordPress Engineer's role. It focuses on using Twig and Timber for theme development. By understanding the material in this course, a WordPress Engineer can create WordPress themes more efficiently. This course's project of creating a website from scratch provides practical experience in applying Twig and Timber concepts to real-world scenarios. Learning to create themes with a modern approach is useful for WordPress Engineers.
User Interface Engineer
A User Interface Engineer focuses on the development and implementation of user interfaces. This course helps in understanding how to use Twig and Timber to develop WordPress themes. The UI Engineer can apply his skills in HTML and CSS. This course can help the User Interface Engineer better understand how to develop dynamic content within themes. A User Interface Engineer will then know how to work within the WordPress environment.
UX Developer
A User Experience Developer bridges the gap between design and functionality, focusing on creating user-friendly interfaces. This course helps UX Developers develop WordPress themes. It teaches how to use Twig and Timber to create custom themes. This course can help UX Developers implement their designs within the WordPress environment. This allows for integration of design with dynamic content.
CMS Developer
A Content Management System Developer builds and customizes websites and applications using CMS platforms. This course is useful for CMS Developers working within the WordPress ecosystem. It teaches how to use Twig and Timber to create WordPress themes. A CMS Developer can use the content in this course to build more maintainable themes. This course may allow a CMS Developer to better modularize code, and to better separate presentation from code.
PHP Developer
A PHP Developer specializes in developing web applications using the PHP programming language. This course introduces PHP developers to Twig and Timber for WordPress. It explores how to use Twig templates for WordPress themes. For a PHP Developer, this course helps create more maintainable and readable WordPress themes. The focus on separating template logic from PHP code can also lead to more organized and efficient development workflows. PHP developers who want to enhance their WordPress development skills may consider this course.
Frontend Developer
A Frontend Developer implements the user interface of websites and web applications. This course may be useful to Frontend Developers utilizing WordPress. It covers Twig and Timber for WordPress theme development. The course assists in understanding template inheritance, conditional logic, and loops in Twig. This course may help frontend developers integrate dynamic content into their front-end designs more effectively, particularly when working with WordPress-based projects. The separation of concerns that is emphasized by the course may also lead to cleaner and improved code.
Full-Stack Developer
A Full Stack Developer works on both the front-end and back-end of web applications. This course may be useful for full stack developers working with WordPress. It introduces Twig and Timber for WordPress theme development. Gaining proficiency in Twig and Timber can empower full stack developers to manage both the server-side logic and the presentation layer of WordPress sites effectively. Learning to separate template logic from presentation may be useful for full stack developers who want to create cleaner, more maintainable, and more scalable WordPress applications.
Web Designer
A Web Designer creates the visual layout and user experience of websites. This course may be useful for web designers who want to build websites using WordPress. Understanding how to use Twig and Timber helps a web designer create custom themes and templates. By understanding the fundamentals taught in this course, the web designer may gain a clearer understanding of how design translates into functional WordPress themes and integrate dynamic elements into their designs.
Web Application Developer
A Web Application Developer designs and develops interactive web applications. While this course focuses on WordPress theme development, which is more related to website presentation, it may be useful. This course may help to learn Twig and Timber. The skills learned can be applied to other web application projects involving templating and presentation logic. Web application developers who want to explore WordPress development or incorporate similar templating concepts into their projects may find this course helpful.
Interaction Designer
An Interaction Designer focuses on designing interactive elements and experiences for digital products. This course may be useful for interaction designers seeking to enhance their WordPress design skills. This course teaches how to use Twig and Timber to create WordPress themes. This course may help interaction designers understand how to integrate interactive elements into WordPress themes, using Twig and Timber to implement dynamic functionality and engaging user experiences.
Software Engineer
A Software Engineer designs, develops, and tests software applications. While this course is specific to WordPress theming, it may be useful to software engineers. Concepts such as templating, modularization and separation of concerns are transferable. This course's coverage of Twig and Timber can potentially expand a software engineer's toolkit for managing presentation layers in web projects. Software engineers with an interest in web development or WordPress may find value in this course.
Digital Strategist
A Digital Strategist develops and executes digital marketing strategies. This course may be useful for digital strategists interested in customizing WordPress websites. The course helps one understand WordPress theme development through Twig and Timber. This course may help a digital strategist better understand the capabilities and limitations of WordPress themes. This knowledge may then inform their strategic decisions regarding website design and content delivery.
Technical Consultant
A Technical Consultant provides expert advice and guidance on technology-related matters. While this course focuses on WordPress theme development, it may be useful to technical consultants. The course will give a better understanding of the technical aspects of using Twig and Timber with WordPress. This may then improve communication with clients about technology issues. This course may help technical consultants provide more informed recommendations to clients using WordPress.

Reading list

We've selected two books that we think will supplement your learning. Use these to develop background knowledge, enrich your coursework, and gain a deeper understanding of the topics covered in Wordpress Theme Development with Twig and Timber.
Provides a foundational understanding of WordPress theme development. While the course uses Twig and Timber, understanding the traditional WordPress theming system is helpful for context. This book covers the basics of creating WordPress themes, including template files, theme functions, and the WordPress template hierarchy.
While this course focuses on theme development, understanding plugin development can enhance your ability to customize WordPress. provides a comprehensive guide to plugin development. It's more valuable as additional reading to broaden your WordPress knowledge. It can help you understand how plugins interact with themes and how to leverage them in your Twig and Timber projects.

Share

Help others find this course page by sharing it with your friends and followers:

Similar courses

Similar courses are unavailable at this time. Please try again later.
Our mission

OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.

Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.

Find this site helpful? Tell a friend about us.

Affiliate disclosure

We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.

Your purchases help us maintain our catalog and keep our servers humming without ads.

Thank you for supporting OpenCourser.

© 2016 - 2025 OpenCourser