Download the PHP package mejta/wp-latte without Composer
On this page you can find all versions of the php package mejta/wp-latte. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mejta/wp-latte
More information about mejta/wp-latte
Files in mejta/wp-latte
Package wp-latte
Short Description WordPress mu-plugin that implements Nette Latte templating engine
License GPL-2.0-or-later
Informations about the package wp-latte
Nette Latte Engine for WordPress
This mu-plugin gives theme and plugin developers availability to write templates with Nette Latte v2.5.
Requirements
WordPress: 4.7+ PHP: 5.6.0+ License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html
Instalation with Composer
- Go to
wp-content/mu-plugins
folder and require wp-latte withcomposer require mejta/wp-latte
command. - Don't forget to load composer dependencies in your loader (e.g.
wp-content/mu-plugins/load.php
):
Instalation with Git
- Go to
wp-content/mu-plugins
folder and clone the repository withgit clone [email protected]:mejta/wp-latte.git
command. - Go to plugin folder with
cd wp-latte
- Install composer dependencies with
composer install
- Don't forget to load the plugin in your loader (e.g.
wp-content/mu-plugins/load.php
):
Usage
After plugin activation, you can use Nette Latte templates in your theme. Just use .latte
file extension instead of .php
. Template files with .php
extension will continue to work, but that templates will have lower priority in template resolution.
There are limitations with header.php
and footer.php
. You should use instead {php wp_head()}
and {php wp_footer()}
macro inside layout file. If you need to use header.php and footer.php file (e.g. for WooCommerce plugin), leave that files blank.
If you want to have a fallback for a case when the plugin is not activated, add index.php
inside your theme folder with some meaningful message that says that there is plugin needed.
You can also define your custom filters and macros. Use the following code in your functions.php
file.
If you want define custom post template, create a template file in theme root directory and put the comment block at the begining of the file like this:
Contribution
Feel free to improve the plugin and open pull request in the Github repository.