CMS Development
#02 - WP Theming
Installatie
Installatie Wordpress
Kan op meerdere manieren.
In CMS Development zullen we gebruik maken van de Bedrock Filestructuur, mits we Wordpress zullen gebruiken voor developer-doeleinden
(ipv traditioneel Thema installatie)
Installatie Wordpress
Installatie Wordpress via composer
$ composer create-project roots/bedrock
Na installatie moeten de environment variabelen ingesteld worden
Database variables
WP_ENV - Set to environment (development, staging, production)WP_HOME - Full URL to WordPress home (https://example.com)
WP_SITEURL - Full URL to WordPress including subdirectory (https://example.com/wp)
AUTH_KEY, SECURE_AUTH_KEY, LOGGED_IN_KEY, NONCE_KEY, AUTH_SALT, SECURE_AUTH_SALT, LOGGED_IN_SALT, NONCE_SALTThemes
Thema / Theme
Met een Theme bepaal je de look & feel van de website
Bepaalt het uiterlijk, zonder de inhoud te wijzigen
WP Thema = een folder met bestanden
Templates
Assets (media)
Stylesheets
Scripts
Functions
WP Theme
Traditionele Installatie (twentytwentyone = thema naam)
Bedrock Installatie
default wp themes (twentytwenty = thema naam)
eigen/custom themes (sleutel = thema naam)
WP Theme directory
WP Theme toevoegen
WP Theme toevoegen
WP Theme toevoegen
Eigen, custom theme bouwen
How to theme
Theming
Folder aanmaken in themes directory
Naamgeving
enkel tekstueel, geen spaties, hoofdletters of vreemde tekens
Een thema moet minstens volgende bestanden bevatten
style.css
index.php
Theming
style.css
Geen css,
enkel voor theme info (ontwikkelaar, thema naam, ...)
Theming
index.php
- main template file
- catch-all template voor elke pagina/post/overzicht/…
- verplicht aanwezig in elk thema
Theming
screenshot.png
- Niet-verplicht, wel aangeraden
- Naamgeving moet overeenstemmen
- Aanbevolen afmeting: 1200px x 900px
Theming
functions.php
Theming
theme functions.php
Theming
theme functions.php <-> plugin
Theming
FOLDER STRUCTUUR
style.css
in root ditrectory (thema credentials)
Nota:
De thema-stijlen zelf zetten we meestal
apart in vb. folder assets/css
Theming
FOLDER STRUCTUUR
inc
functionaliteiten (vb OOP-structuur)
template-parts
Theming
FOLDER STRUCTUUR
Theming
FOLDER STRUCTUUR
front-page.php
indien aanwezig, wordt gebruikt
voor de homepage ongeacht de
instelling in het dashboard
search.php
Template voor de zoekresultaten
Template Partials
header.php
sidebar.php
footer.php
comments.php
searchform.php
Wordpress Hierarchy
Wordpress Hierarchy