WordPress Theme Development page-tips.php
Tips
Recommended Local Development Environments for WordPress:
Local by Flywheel – https://localwp.com/
XAMPP – https://www.apachefriends.org/
MAMP – https://www.mamp.info/
Vagrant – https://varyingvagrantvagrants.org/
DevKinsta – https://kinsta.com/devkinsta/
DesktopServer – https://serverpress.com/
Docker – https://www.docker.com/
At some point, be prepared to adapt the draft stylesheet you make for HTML or PHP pages to WordPress functions, methods and widgets. You’ll need to identify the class and ID attributes they generate and use them to select them with CSS.
When transferring your database from one location to another you can force WordPress to recognise the correct base URL by adding the following code to your wp-config.php file.define('WP_HOME','https://example.com');
define('WP_SITEURL','https://example.com');
Start converting Content – Either you’ll be starting from scratch, or more typically you’ll be copying markup over from static HTML or PHP files you created as drafts. Start by mirroring your file structure from your draft files to your WordPress theme.
You have a choice as to whether you want your “homepage” to be served by home.php or front-page.php and that choice is made by your “Reading” settings in the WordPress admin area.
The WordPress Template Hierarchy is the system that WordPress uses to know which template to serve and when to do it. If WordPress does not see the template it needs to see, it falls back to the next template; all the way back to index.php.
I want to talk about using Custom Fields. These are sometimes necessary when you need to make unique content that can’t be part of the main post
In WordPress, page.php templates deliver the content from the file, and therefore the same page design. But sometimes you need to have pages that are distinct from others with a unique design and purpose. You can do this by providing template files that can be specifically selected on a WordPress Page.
In WordPress, Widgets are used to provide various bits of useful content without the need to write code. They are managed through the WordPress admin area under Appearance > Widgets, where you can drag and drop them into designated widget areas.
With Template Parts, you can organise code blocks into separate files which can make themes easier to maintain and your code more readable.
Keep your passwords and database information secure. I have all mine in a Keepass database.