Automatisch copyright jaartal in WordPress footer toevoegen
Het toevoegen van een automatisch copyright jaartal in de footer van je (WordPress) website doe je als volgt.
- Code toevoegen
Voeg onderstaande CSS code toe in de functions.php van je WordPress theme
- Shortcode gebruiken
Gebruik de shortcode 2023 op de plaats waar je het jaartal wilt tonen, bijvoorbeeld in een footer widget.
De CSS code
Voeg onderstaande CSS code toe in de functions.php van je WordPress thema:
function year_shortcode() {
$year = date('Y');
return $year;
}
add_shortcode('year', 'year_shortcode');
De shortcode
Gebruik de volgende shortcode om het huidige jaartal weer te geven:
[year]