0

I am launching Christmas pages across 8 different websites which share almost the same code. What is the best way to distribute this?

The files include:

  • christmas page
  • style.css
  • swipbox.js

At the moment, if I make a change in one of the files, i'd need to make it in all of them.

Would you advise creating a plugin for this?... suggestions?

1
  • You know it's August, right?
    – vancoder
    Commented Aug 24, 2016 at 20:07

1 Answer 1

1

You can bundle the files into a plugin.

For the Christmas page, you could use the page_template filter - This question gives you an example on how to use it - Create custom page templates with plugins?

For the CSS/JS file, you can add them using the wp_enqueue_scripts action, as you would normally use in a theme. The only difference is that you'll need to use plugin_dir_url() to link to the target files.

Finally, for updating the plugins easily, there are a bunch of libraries like this one which allows you to have the one click updates for your plugins like you normally have for plugins hosted in the WordPress repositories.

3
  • Thanks! I think what i'll do is create a plugin to generate a unique page and use a custom template for that page.
    – jake
    Commented Aug 24, 2016 at 10:39
  • With plguins, Is it possible to create a custom page and use the standard file formatting of page-mypage.php as the template for this page? and keep all the files within the plugin folder?
    – jake
    Commented Aug 24, 2016 at 11:11
  • Yes it is possible, plugins like Woocommerce do that. You gotta research how it's done though.
    – RRikesh
    Commented Aug 24, 2016 at 13:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.