What are some common pitfalls to avoid when trying to customize Joomla templates using PHP?

One common pitfall to avoid when customizing Joomla templates using PHP is directly modifying core files, as this can lead to compatibility issues and make future updates challenging. Instead, it is recommended to use template overrides to make changes to the layout and functionality of your Joomla site.

// Example of using template overrides in Joomla
// Create a folder in your template directory named 'html' to store overrides

// Override the default layout of a component
// Create a folder named 'com_content' inside the 'html' folder
// Copy the default layout file from components/com_content/views/article/tmpl/default.php
// Make your desired changes to the copied file

// Override a module layout
// Create a folder named 'mod_login' inside the 'html' folder
// Copy the default layout file from modules/mod_login/tmpl/default.php
// Make your desired changes to the copied file