My question had nothing to do with pre-made themes. It's about modifying a plugin that will work with child themes, pre-made or custom.
I found my answer, which is posted below.
PHP Code:
<?php
/*
Plugin Name: PHP File Includer
Description: Include PHP files using a shortcode
Version: 1.0
For using the plugin with a child theme
http://codex.wordpress.org/Function_Reference/get_stylesheet_directory
For normal usage, use this query
include(get_theme_root() . '/' . get_template() . "/inc/$file.php");
*/
// include PHP file
// usage = [phpinclude file='myfilename']
function PHP_Include($params = array()) {
extract(shortcode_atts(array(
'file' => 'default'
), $params));
ob_start();
// get file from child theme
include(get_stylesheet_directory() . "/inc/$file.php");
return ob_get_clean();
}
// register shortcode
add_shortcode('phpinclude', 'PHP_Include');
?>
Bookmarks