Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Add plugin to theme
#1
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
Reply
#2
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).
Reply
#3
(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...
Reply
#4
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...)
Reply




Users browsing this thread: 1 Guest(s)