The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End include_once issue Reply To: include_once issue


@chrisburton @traq I found part of the issue
in the file I was trying to include I replaced a line a while ago with this//
include_once $_SERVER['DOCUMENT_ROOT'] . "/metaboxes/";
(Why? I have no idea…)

Replacing that line with the original “define” code did the trick:

define( 'CUSTOM_METABOXES_DIR', get_template_directory_uri() . '/metaboxes' );

Then I used this inside of my must-use.php file:

include_once( 'metaboxes/meta_box.php' );

Now it works except my whole point in using must-use.php for my CPT is so I wouldn’t have to register the PT for every single theme I create…
This line:

define( 'CUSTOM_METABOXES_DIR', get_template_directory_uri() . '/metaboxes' );

Gets the directory from my theme’s folder…
But if I delete “metaboxes” the css and javascript gets disabled from my post type edit screen…

How can I define “/metaboxes” from my mu-plugins folder?

I found this post:

Which looks to me like a solution…but I wasn’t able to get it to work.