Please do not be afraid of asking questions?
(There are no stupid or dumb questions!)
How can I dynamically set my Smarty variables before loading my Smarty template
- Use a third party plugin called, Exec-PHP (http://wordpress.org/extend/plugins/exec-php/) permits execution of PHP code from the post/page. You can them use smarty_get_instance to set your variables and load your template from within your WP pages/posts.
How do I change WP_USE_THEMES to false without changing WordPress core files like index.php
- You need to install runkit on your web server and then in your wp-config.php, you need to add the following two lines: runkit_constant_remove('WP_USE_THEMES'); define('WP-USE_THEMES',false); Now Wordpres themes will be turned off and load the Smarty Loader instead, if enabled.
- See http://php.net/manual/en/runkit.installation.php for assistance on installing runkit
What configurations are needed to load Smarty without WordPress themes
- You need to specify two constants in your wp-config.
- define('SMARTY_PATH','/var/www/smarty'); // where your smarty files are located
- define('SMARTY_LOADER','/var/www/smartyloader.php'); // the name of the file which will load your smarty files
My Smarty templates are not loading from the Smarty loader, I just get a blank screen
- You need to invoke the plugin function smarty_get_instance() and assign to your $smarty variable.
How do I access the WPDB object from the Smarty Loader
- use the syntax global $wpdb; within the smarty loader file.