1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

WordPress: How to integrate plugin with theme?

Discussion in 'PHP' started by ChiragKalani, Apr 14, 2013.

  1. #1
    I am creating a wordpress theme which require many features which I can add using plugins. But I dont want those plugin to be installed in using plugins. I want theme integrated with theme.

    So that when I activated the theme, all plugin will work automatically without downloading and installing those plugin.

    Thanks in advance.
     
    ChiragKalani, Apr 14, 2013 IP
  2. sarahk

    sarahk iTamer Staff

    Messages:
    28,500
    Likes Received:
    4,460
    Best Answers:
    123
    Trophy Points:
    665
    #2
    You can add code into the functions.php file. If you look at woothemes, for instance, they do that.
     
    sarahk, Apr 15, 2013 IP
  3. ChiragKalani

    ChiragKalani Active Member

    Messages:
    41
    Likes Received:
    2
    Best Answers:
    3
    Trophy Points:
    73
    #3
    How woothemes do that? Could you please explain here?
     
    ChiragKalani, Apr 15, 2013 IP
  4. sarahk

    sarahk iTamer Staff

    Messages:
    28,500
    Likes Received:
    4,460
    Best Answers:
    123
    Trophy Points:
    665
    #4
    How experienced at WordPress plugin development and theme development are you? It should be pretty self explanatory.
     
    sarahk, Apr 15, 2013 IP
  5. ChiragKalani

    ChiragKalani Active Member

    Messages:
    41
    Likes Received:
    2
    Best Answers:
    3
    Trophy Points:
    73
    #5
    I have 4+ year experience in wordpress theme and plugin and developed number of custom plugin for customers. I have read many blogs to make it work but not sure those are correct way. Some saying including file in function.php, some says copy and paste code of plugin in function.php. Not sure which is correct.

    I want it like bundled with Wordpress Theme, Also it is not require to so those plugin on wordpress admin plugin page and also not require to update it. As I customized it to work with my theme.
     
    ChiragKalani, Apr 15, 2013 IP
  6. sarahk

    sarahk iTamer Staff

    Messages:
    28,500
    Likes Received:
    4,460
    Best Answers:
    123
    Trophy Points:
    665
    #6
    The "correct" way is to bundle the plugin into the zip file but keep it separate. You, however, want to do it differently. You'll have to experiment a bit - the biggest thing is keeping the namespace rule so that your work doesn't clash with any other plugins your users may choose to install.
     
    sarahk, Apr 15, 2013 IP
  7. ChiragKalani

    ChiragKalani Active Member

    Messages:
    41
    Likes Received:
    2
    Best Answers:
    3
    Trophy Points:
    73
    #7
    Thanks. Let me clear my question with example.

    I want to implement functionality for example most popular posts in my theme. This can be done through Plugin available in WordPress Plugins. I want make this plugin to work with my theme and I have made several change to work fine. I do want to tell the client that you need to install this plugin to make the theme work properly. I want to add same functionality in theme using plugin so that client only need to activate that theme and all is done.

    Is there any readymade way to do this in wordpress? Or I have to copy the pluging in wordpress theme and make several change to make plugin to work from theme folder?
     
    ChiragKalani, Apr 15, 2013 IP
  8. ds28

    ds28 Greenhorn

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    6
    #8
    you can keep plugin in plugins folder and activate it from your themes folder's function.php as soon as theme is loaded. there are functions for this and you can check codex.
     
    ds28, Apr 24, 2013 IP