WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Embed a plugin in template (10 posts)

  1. degamer12
    Member
    Posted 3 years ago #

    Hi all,

    I have a little problem. I am working on a default template so that I have a nice base template on witch I can build my sites. The only problem now is that I have to reinstall all my plugins everytime I want to use my base template. Is there a way to put the plugin in my template directory and still get it installerd ? I am talking about the SEO plugin from Yoast.

    Thanks in advance,
    Bob

  2. Chip Bennett
    Theme Review Admin
    Posted 3 years ago #

    I don't understand your question.

    Changing Themes doesn't impact installed/active Plugins.

  3. degamer12
    Member
    Posted 3 years ago #

    I want that a plugin gets integrated with my theme. That way, when you install my theme, you dont need to install plugins seperadly but that automaticly happends when you install my theme. So it is kinda like the plugins are embedded in my theme.

  4. Chip Bennett
    Theme Review Admin
    Posted 3 years ago #

    That's generally a bad idea, because it conflates the presentation and management/creation of content. Themes handle the former, and the latter is best left to Plugins.

    For example, Yoast SEO handles things that should remain constant, independent of which Theme is currently in use.

    A better approach would be to develop your Theme such that it accommodates and/or supports/implements a particular Plugin.

    A common example might be Yoast Breadcrumbs or WP-PageNavi. Both of these Plugins provide template tags to output their content; to integrate them into your Theme, simply call the template tag, wrapped in a function_exists() conditional. e.g.:

    if ( function_exists( 'yoast_breadcrumbs' ) {
         yoast_breadcrumbs();
    } else {
         // some default content goes here
    }
  5. degamer12
    Member
    Posted 3 years ago #

    Ok, but I still want it. Could you help with it ?

  6. Chip Bennett
    Theme Review Admin
    Posted 3 years ago #

    Can I recommend an alternative: Plugin Central

  7. degamer12
    Member
    Posted 3 years ago #

    I will look into it. Thanks for the advice.

  8. paradiselost79
    Member
    Posted 3 years ago #

    I know it sounds like a time saver for you if you use the same basic theme a lot, but Chip seems on the right idea. There is a good chance the plugins will still need to be customized by every user, and if you did somehow have them come along with the theme taking them out could cause big code problems.

  9. paradiselost79
    Member
    Posted 3 years ago #

    @chip, that plugin central is bad a$$, just found it. Thanks!

  10. Chip Bennett
    Theme Review Admin
    Posted 3 years ago #

    @chip, that plugin central is bad a$$, just found it. Thanks!

    Yeah, Vladomir writes some pretty awesome code!

Topic Closed

This topic has been closed to new replies.

About this Topic