WordPress Theme with Timber, ACF and acf-builder
Install this theme and be sure the Timber plugin is activated (see dependencies):
- Install current WordPress Version
- Setup localhost in your local-server (Naming-Convention: projectname.test - z.B. 3qbik-gloeckle-wp-website-skl.test)
- Install and activate plugins: Timber Library and Advanced Custom Fields
- Download the zip for this theme (or clone it) and move it to
wp-content/themes/custom-theme-name
in your WordPress installation. - Rename the folder (custom-theme-name) to something that makes sense for your website (generally no spaces and all lowercase).
- Activate the theme in WordPress Backend > Appearance > Themes.
- Open console in path
wp-content/themes/custom-theme-name/_config
.- Use command
npm install
oryarn install
to install dependencies. - Use command
ncu
to update dependencies.
- Use command
- Open file
wp-content/themes/custom-theme-name/_config/config.json
and rename host-settings to"host": "projectname.local"
. - Open file
/wp-config.php
and add the linedefine( 'WP_DEBUG', true );
below$table_prefix = 'wp_';
at the bottom of the file.
- Go to phpMyAdmin
http://localhost/phpMyAdmin/
chose the project database, then chose tableprefix_options
and add the"host": "http://projectname.test"
to the rowssiteurl
andhome
- Go to WordPress Backend
http://projectname.test/wp-admin/options-permalink.php
and set/save permalinks
This theme is build with Timber and ACF (including acf-builder). Therefore you need to install these plugins first, before you activate the theme!
src/
is where you can keep your development front-end scripts, styles, or images.
templates/
contains all of your Twig templates. These pretty much correspond 1 to 1 with the PHP files that respond to the WordPress template hierarchy. At the end of each PHP template, you'll notice a Timber::render()
function whose first parameter is the Twig file where that data (or $context
) will be used.
inc/
contains all PHP functionality you want to add to your theme - these files get included in the functions.php
.
inc/acf/
is where you register you ACF fields. All ACF fields get included automatically!