• I am working on a new project on WordPress.
    I am developing a new website for a client based on their actual site (developed by an other team). So, I decided to create a new WordPress theme and to use the existing content (client’s request).
    However, this supposes to reuse the custom plugins, in order to not re upload the pictures and the articles by hand.
    I would like to include the custom plugins into the new theme. However, the plugins folder is outside the theme folder. So I was wondering if you have an idea on how I could transfer the code of a custom plugin into the new theme.
    Thank you in advance.

Viewing 2 replies - 1 through 2 (of 2 total)
  • By integrating them into a theme, you lose the ability to activate/deactivate them if necessary, nor can you update them. Please consider that first.

    Ok, so to incorporate them into your theme, this is what you would do…

    Create a “plugins” folder within your theme.
    Place plugins in that folder.
    Within your functions.php file, use require_once to load each of the plugins default php files (if the plugin authors correctly followed convention, the main plugin file will be the one that matches the plugin folder name).
    Done.

    Please also take note that you may have problems with activation/deactivation functions… so be careful.

    Thread Starter coralies

    (@coralies)

    Thank you @jaycbrf

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Transfer the code of a custom plugin into a new theme’ is closed to new replies.