Forums

[resolved] Themes With Plugins INTERGRATED.. (6 posts)

  1. Lou Sparx
    Member
    Posted 1 year ago #

    Hey,

    I'm a designer by trade and have a few themes about to be released (free). My themes work so much better with a few plugins and was wondering how to intergrate plugins into my themes so the end user doesn't have to download/install?

    Obviously with the plugin developers permission. I noticed a meta tag plugin was a single php file so I tried to call it from my header ie along the lines of.. [template include PLUGIN.php] etc. but my theme returned a blank.

    I understand some plugins change core files but I'm talking about simple ones that just add a certain color and or meta tag for example.

    Any help would be much appreciated.

    Lou

  2. James
    Happiness Engineer
    Posted 1 year ago #

    If the plugin came with some sort of an include code, you can use it to place it where ever you want it to appear within your theme. Just make sure to use if( function_exists() to prevent the theme from breaking if the user chooses not to use the specific plugin. For example, Add to Any's Share Button include code:

    <?php if( function_exists('ADDTOANY_SHARE_SAVE_KIT') ) { ADDTOANY_SHARE_SAVE_KIT(); } ?>

    See this for more info:

    http://codex.wordpress.org/Managing_Plugins#Hiding_Plugins_When_Deactivated

  3. Lou Sparx
    Member
    Posted 1 year ago #

    Thanks but that would still require the user to install X-plugin.

    It's a tough subject but I'm sure I've seen themes come with pre-installed plugins.

  4. James
    Happiness Engineer
    Posted 1 year ago #

    Oh, you mean you actually want the plugin functions to be a part of theme?

    In that case, you'd have to mimic the plugins' functions in a functions.php file within the theme. See this for more info:

    http://codex.wordpress.org/Theme_Development#Functions_File

  5. Lou Sparx
    Member
    Posted 1 year ago #

    Cheers James you said what I tried to explain lol. The php file that came with the plugin is quite basic so I mite try a copy/paste the code direct into my functions.php.

    Probably wont work but I'm on the right track, hopefully.

    Thanks

  6. James
    Happiness Engineer
    Posted 1 year ago #

    You're welcome!

Topic Closed

This topic has been closed to new replies.

About this Topic