1

So here's the problem, I want to have a few different meta boxes on my sites, but I'd like to be able to store each of them in separate files and included them into functions, so I can just copy specific ones to new installs and included them on a case by case basis.

From what I can gather though, it seems like I need to put them all into one array?

  • Have you seen this at all? voodoopress.com/2011/04/… I've been playing around with it recently and really dig it. I can use it to set up any possible meta box I could want (text, wysiwyg, image, etc). You then just set up site specific meta box instances in your functions.php. – Rev. Voodoo May 16 '11 at 13:14
  • the answer really depends on your setup and code. so provide some. – Bainternet May 16 '11 at 13:56
2

Save each meta box out to a file with the code as if they were in your functions.php file. Maybe place these in a folder called meta_boxes. Then to include into your theme just include() them into your functions file

<?php
// all the code that your functions file contains
include("meta_boxes/meta1.php");
include("meta_boxes/meta2.php");
include("meta_boxes/meta3.php");
include("meta_boxes/meta4.php");
// As so on....
?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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