2010-10-30, 19:02:28
Some other possible options...
- Just insert code in your theme's template.php file (wherever you want it):
(Of course you can use if...else or switch...case... sentences, for several pages, different code, etc.)
- Another option is stuffing that code into a function, and call it using one of GetSimple's front-end hooks. Example:
This can be done either in your theme's functions.php file, or by creating your own custom plugin.
(The plugin option may be better because your code will be executed with any theme: no need to edit themes or copy the functions.php file.)
- Just insert code in your theme's template.php file (wherever you want it):
Code:
<?php
if (return_page_slug()=='page-with-php-code') {
/* your code here */
}
?>
(Of course you can use if...else or switch...case... sentences, for several pages, different code, etc.)
- Another option is stuffing that code into a function, and call it using one of GetSimple's front-end hooks. Example:
Code:
<?php
add_action('content-top','my_php_code');
function my_php_code() {
if (return_page_slug()=='page-with-php-code') {
/* your code here */
}
}
?>
This can be done either in your theme's functions.php file, or by creating your own custom plugin.
(The plugin option may be better because your code will be executed with any theme: no need to edit themes or copy the functions.php file.)