-
Notifications
You must be signed in to change notification settings - Fork 0
Resources
In the resources
folder you can start to edit the file for your theme. First of all, you may edit the wp_footer.php
and the wp_head-php
files.
π resources
β wp_footer.php
β wp_head.php
The wp_footer.php
file will be included on the wp_footer
hook. In the same way, the wp_head.php
will be included on the wp_head
hook. They are empty for default. For example, if you need to add some meta tag in the head of page, you can add you code directly in the wp_head.php
file.
<?php
/**
* This file is included in the wp_head() hook.
*
* Add here your head includes. For example
*
* <meta name="viewport" content="width=device-width, initial-scale=1.0">
*
*/
?>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
In addition, remember that you may use spock()
function to get the instance of WP Spock theme. Of course, you may use also any PHP statements.
<?php
/**
* This file is included in the wp_head() hook.
*
* Add here your head includes. For example
*
* <meta name="viewport" content="width=device-width, initial-scale=1.0">
*
*/
if(spock()->Version === '1.0.0') : ?>
<meta name="version" content="ok"/>
<?php endif;
Usually, you'll use the assets
forlder for your Javascript and LESS file. WP Spock comes with a configuration to compile LESS files. Anyway, feel free to configure your package.json
and your environment how you wish.
π resources
βπ assets
| βπ images --> put your images here
| βπ js --> js watcher
| βπ less --> less watcher
To compile the assets just run yarn watch
in your terminal.
The most important files, I mean, the core of the theme, is in the views
folder. In fact, you won't have to edit the usual file on the root of the theme. You'll use the files in the views
folder.
π resources
βπ views
| βπ errors
| | β 404.php
| βπ footer
| | β entry-footer.php
| | β footer.php
| | β index.php
| βπ header
| | β entry-header.php
| | β header.php
| | β index.php
| βπ main
| β π content
| β π post
| β archive.php
| β comments.php
| β index.php
| β page.php
| β search.php
| β sidebar.php
| β single.php
As you can see, WP Spock provides a better structure for the common files.
Prolouge
Getting Started
Appendix