* @copyright Copyright (c) 2016, nuThemes * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html **/ /** * Setup empty object to use when needed. */ global $nuthemes; $nuthemes = new stdClass; /* Add theme name in the object. */ $nuthemes->name = esc_attr( get_template() ); $nuthemes->child = esc_attr( get_stylesheet() ); /* Add nuthemes directory/folder (not path) in the object. */ $nuthemes->dir = basename( dirname( __FILE__ ) ); /* === LOAD FUNCTIONS === */ /* Load File Loader. */ require_once( trailingslashit( get_template_directory() ) . $nuthemes->dir . '/functions/helper.php' ); /* Load text string used within the framework. */ nuthemes_include( 'functions/strings', true ); /* Load various sanitization functions. */ nuthemes_include( 'functions/sanitize', true ); /* Load default setup and helper functions. */ nuthemes_include( 'functions/setup', true ); /* Load template-tag functions on site front end. */ if ( !is_admin() ) { /* General */ nuthemes_include( 'functions/template/general', true ); /* Pagination */ nuthemes_include( 'functions/template/pagination', true ); /* Sidebar */ nuthemes_include( 'functions/template/sidebar', true ); /* Entry */ nuthemes_include( 'functions/template/entry', true ); /* Authorbox */ nuthemes_include( 'functions/template/author-box', true ); /* Attachment */ nuthemes_include( 'functions/template/attachment', true ); /* Navigation Menu */ nuthemes_include( 'functions/template/menus/menu', true ); /* Comment */ nuthemes_include( 'functions/template/comments/comment', true ); /* Load front-end utility functions for faster development ( min PHP 5.3 ) */ if ( version_compare( PHP_VERSION, '5.3.0', '>=' ) ) { nuthemes_include( 'functions/template/utility', true ); } } /* === LOAD MODULES === */ /* Load custom theme features. */ add_action( 'after_setup_theme', 'nuthemes_load_theme_support', 15 ); /** * Load various modules only when theme add supports for it. * * @since 1.0.0 * @return void */ function nuthemes_load_theme_support(){ /* === BACK COMPAT === */ nuthemes_require_if_theme_supports( 'nuthemes-back-compat', 'modules/back-compat' ); /* === MICRODATA FILTERS === */ if( !is_admin() ) nuthemes_require_if_theme_supports( 'nuthemes-microdata', 'modules/microdata' ); /* === SIDEBARS === */ nuthemes_require_if_theme_supports( 'nuthemes-sidebars', 'modules/sidebars' ); /* === FULL SIZE BACKGROUND === */ if ( current_theme_supports( 'custom-background' ) ){ nuthemes_require_if_theme_supports( 'nuthemes-full-size-background', 'modules/full-size-background' ); } /* === HIDE PAGE TITLE === */ nuthemes_require_if_theme_supports( 'nuthemes-hide-page-title', 'modules/hide-page-title' ); /* === FOOTER TEXT === */ nuthemes_require_if_theme_supports( 'nuthemes-footer-text', 'modules/footer-text' ); /* === CUSTOM FONTS === */ nuthemes_require_if_theme_supports( 'nuthemes-custom-fonts', 'modules/custom-fonts/custom-fonts' ); /* === LAYOUTS === */ nuthemes_require_if_theme_supports( 'nuthemes-layouts', 'modules/layouts/layouts' ); /* === POST FORMATS SETUP === */ if( !is_admin() ) nuthemes_require_if_theme_supports( 'post-formats', 'modules/post-formats' ); /* === SOCIAL LINKS === */ nuthemes_require_if_theme_supports( 'nuthemes-social-links', 'modules/social-links' ); }