GetSimple Support Forum

Full Version: Add plugin to theme
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have image viewer plugin and I would like to put in the template.php file. Can this be done and how? Rolleyes

Thank you
Is this a full GetSimple plugin or a php script? If it is the latter, you can add the functions in the script to a file called 'functions.php' in your theme folder and call the functions in your template.php file.

(If it is the former...why do you want to put a plugin into the template? If the theme depends on the plugin working, you can provide the zip file with the theme in a /theme/ folder and the plugin in a /plugins/ folder so that when the user unzips the file onto their site, they have the plugin on their installation (they'd still need to enable it from the Plugins page).
(2013-06-08, 17:51:57)Angryboy Wrote: [ -> ]Is this a full GetSimple plugin or a php script? If it is the latter, you can add the functions in the script to a file called 'functions.php' in your theme folder and call the functions in your template.php file.

(If it is the former...why do you want to put a plugin into the template? If the theme depends on the plugin working, you can provide the zip file with the theme in a /theme/ folder and the plugin in a /plugins/ folder so that when the user unzips the file onto their site, they have the plugin on their installation (they'd still need to enable it from the Plugins page).

It is a full GetSimple plugin... It is an image rotator... I would like to have images rotating on every page in the header section...
Oh, so are you asking how to have the plugin actually be called by the theme? (if so then you are looking for the theme hook that can call the plugin in your theme header - add this to your main plugin file):

Code:
add_action('theme-header', 'name_of_image_rotator_function', array());

(Sorry if I've still misunderstood your request...)