Confused on how to include a Custom Post Type file into a Child Theme
-
Hey Guys,
I’m working in a child theme and am trying to include a custom post type file into the functions.php
Here is what I have been trying, but to no avail:
function agility_child_setup() { global $agilitySettings; $GLOBALS['cpt_service'] = new ServicePostType(); $GLOBALS['cpt_special'] = new SpecialPostType(); } add_action( 'after_setup_theme', 'agility_child_setup' ); function agility_child_load_module( $module , $rootFile='' ){ if( $rootFile == '' ) $rootFile = $module; require_once( "modules/$module/$rootFile.php" ); } function agility_child_load_modules(){ agility_child_load_module( 'service' ); agility_child_load_module( 'special' ); }
The “Service” and other custom post type files are in there seperate folders located at child-theme/modules/customposttype/customposttype.php
Any help would definitely be appreciated.
Thanks!
- The topic ‘Confused on how to include a Custom Post Type file into a Child Theme’ is closed to new replies.