În forma cea mai simplificată de realizare a unei teme WordPress este necesară crearea a patru fişiere:
- index.php
- style.css
- header.php
- footer.php
index.php
1 2 3 |
<?php get_header();?> <h1>Acesta este index</h1> <?php get_footer();?> |
style.css
Detaliile implicite ale acestui fişier face trimitere la câteva aspecte care vor fi vizibile, când se alege tema, din WordPress, după cum se observă şi în figura articolului.
1 2 3 4 5 6 7 8 9 10 |
/* Theme Name: SOI 3 Author: Ovidiu.S Author URI: https://ovio.ro Description: Aceasta este o tema SOI (experimentala) Version: 1.0 alpha License: GNU General Public License v3 or later License URI: https://www.gnu.org/licenses/gpl-3.0.en.html Tags: blue, white, responsive, three columns, custom-menu, custom-header, post-formats */ |
header.php
1 2 3 4 5 6 7 8 |
<!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <title>SOI 3</title> </head> <body> |
footer.php
1 2 3 4 5 |
<footer> <p>Subsol site</p> </footer> </body> </html> |
După cum se poate remarca, etichetele HTML şi BODY sunt deschise în header.php şi închise în footer.php.