I want to load wordpress in a smarty template. I used the code below to load wordpress in a php file and it worked. But it is not working a smarty template.
In php file:
<?php
include $_SERVER['DOCUMENT_ROOT'].'/wordpress/wp-load.php';
get_header();
?>
In smarty template file:
{php}
include $_SERVER['DOCUMENT_ROOT'].'/wordpress/wp-load.php';
get_header();
{/php}
Are you using Smarty3? Have a look here.
{php}
tag is deprecated, and from version 3.1 it’s only available usingSmartyBC
class instead ofSmarty
class. They are just the same, but if you instance anew SmartyBC()
object you will have a backward-compatible Smarty object supporting{php}
tags.