I want to call Wordpress functions (the same ones we use to build a theme) from outside the original structure / folder / files of Wordpress.
For example, in my theme folder I created a folder called custom, in which I create files such as header-small.php, header-medium.php, etc. So every one of these custom php files calls WP functions.
I know I must include wp-load.php and it works fine, but I am worried about load time and performance, and whether I am loading more things than I need.
Is there an efficient way to use the API without loading all of Wordpress?
Thanks
<header data-interchange="[<?php get_stylesheet_directory_uri() . '/custom/small.php';?>], (small)"]></header>
It works when I include wp-load.php in small.php file. By the way small is a named media query ...