/** * Total functions and definitions. * * Sets up the theme and provides some helper functions * * When using a child theme (see http://codex.wordpress.org/Theme_Development * and http://codex.wordpress.org/Child_Themes), you can override certain * functions (those wrapped in a function_exists() call) by defining them first * in your child theme's functions.php file. The child theme's functions.php * file is included before the parent theme's file, so the child theme * functions would be used. * * * For more information on hooks, actions, and filters, * see http://codex.wordpress.org/Plugin_API * * @package WordPress * @subpackage Total * @since Total 1.0 */ /*------------------------------------------------*/ /* - Define Constants /*------------------------------------------------*/ define( 'WPEX_JS_DIR_URI', get_template_directory_uri().'/js/' ); define( 'WPEX_CSS_DIR_UIR', get_template_directory_uri().'/css/' ); // To possibly be used later // define( 'WPEX_DUMMY_THUMB_URL', get_template_directory_uri().'/images/base/dummy-image.png' ); /*------------------------------------------------*/ /* - Globals & Theme Setup /*------------------------------------------------*/ // Define the default $content_width variable if ( ! isset( $content_width ) ) $content_width = 980; // Theme setup - load_theme_domain, add_theme_support, register_nav_menus require_once( get_template_directory() .'/functions/theme-setup.php' ); // Recommend some useful plugins for this theme via TGMA script require_once( get_template_directory() .'/functions/recommend-plugins.php' ); /*------------------------------------------------*/ /* - ReduxFramework Admin Panel /*------------------------------------------------*/ // Include the Redux theme options Framework if ( !class_exists( 'ReduxFramework' ) ) { require_once( dirname( __FILE__ ) . '/admin/framework.php' ); } // Tweak the Redux framework // Register all the theme options // Registers the wpex_option function if ( !isset( $redux_demo ) ) { require_once( dirname( __FILE__ ) . '/functions/admin-config.php' ); } // Define branding constant based on theme options $wpex_theme_branding = wpex_option( 'theme_branding', 'Total' ); define( 'WPEX_THEME_BRANDING', $wpex_theme_branding ); /*------------------------------------------------*/ /* - Hooks - VERY IMPORTANT - DONT DELETE EVER!! /*------------------------------------------------*/ if ( ! is_admin() ) { require_once( get_template_directory() .'/functions/hooks/hooks.php' ); require_once( get_template_directory() .'/functions/hooks/hooks-defaults.php' ); } /*------------------------------------------------*/ /* - CSS / JS /*------------------------------------------------*/ // Loads all the core css and js for this theme if ( ! is_admin() ) { require_once( get_template_directory() .'/functions/scripts.php' ); } /*------------------------------------------------*/ /* - Site Styling, Layout, Custom Fonts /*------------------------------------------------*/ // Outputs css for theme panel styling options require_once( get_template_directory() .'/functions/styling.php' ); // Outputs css for theme panel layout options require_once( get_template_directory() .'/functions/layout.php' ); // Outputs custom css from theme options require_once( get_template_directory() .'/functions/custom-css.php' ); // Outputs typography css - fonts require_once( get_template_directory() .'/functions/typography.php' ); // Custom backgrounds on a per-post basis require_once( get_template_directory() .'/functions/custom-backgrounds.php' ); /*------------------------------------------------*/ /* - Other Theme Functions /*------------------------------------------------*/ // Non Admin Function if ( is_admin() ) { // TinyMCE buttons & edits require_once( get_template_directory() .'/functions/tinymce/mce-buttons.php' ); // Gallery metabox function used to define images for your gallery post format require_once( get_template_directory() .'/functions/meta/gallery-metabox/gmb-admin.php' ); // Function used to display featured images in your dashboard columns if ( wpex_option( 'blog_dash_thumbs', '1' ) == '1' ) { require_once( get_template_directory() .'/functions/dashboard-thumbnails.php' ); } // Layerslider mods require_once( get_template_directory() .'/functions/layerslider/layerslider-mods.php' ); // Non Admin functions } else { // Returns the correct grid class based on column numbers require_once( get_template_directory() .'/functions/grid.php' ); // Retuns the correct post layout class require_once( get_template_directory() .'/functions/post-layout.php' ); // Adds additional classes to your posts require_once( get_template_directory() .'/functions/post-classes.php' ); // Show/hide the main header depending on current post meta require_once( get_template_directory() .'/functions/header/header-display.php' ); // Displays the site top-bar require_once( get_template_directory() .'/functions/header/top-bar.php' ); // Adds custom classes to the header container require_once( get_template_directory() .'/functions/header/header-classes.php' ); // Outputs the header logo require_once( get_template_directory() .'/functions/header/header-logo.php' ); // Outputs the header menu require_once( get_template_directory() .'/functions/header/header-menu.php' ); // Outputs the header logo require_once( get_template_directory() .'/functions/header/header-aside.php' ); // Outputs js for your retina logo require_once( get_template_directory() .'/functions/header/retina-logo.php' ); // Custom menu walker used to add classes & icons to menus require_once( get_template_directory() .'/functions/header/menu-walker.php'); // Outputs HTML and loads scripts for the responsive toggle menu require_once( get_template_directory() .'/functions/header/mobile-menu.php' ); // Adds a search icon at the end of the menu require_once( get_template_directory() .'/functions/header/menu-search-icon.php' ); // Get the correct header search toggle style $wpex_search_style = wpex_option('main_search_toggle_style','overlay'); if ( $wpex_search_style == 'overlay' ) { require_once( get_template_directory() .'/functions/search/search-overlay.php'); } if ( $wpex_search_style == 'drop_down' ) { require_once( get_template_directory() .'/functions/search/search-dropdown.php'); } if ( $wpex_search_style == 'header_replace' ) { require_once( get_template_directory() .'/functions/search/search-header-replace.php'); } // Adds custom classes to blog wraps based on blog styles require_once( get_template_directory() .'/functions/blog/blog-classes.php' ); // Exclude blog categories from the main blog page / index require_once( get_template_directory() .'/functions/blog/blog-exclude-categories.php' ); // Displays related blog posts require_once( get_template_directory() .'/functions/blog/blog-related.php' ); // Output custom classes to the body tag require_once( get_template_directory() .'/functions/body-classes.php' ); // Some cool function functions to tweak widgets require_once( get_template_directory() .'/functions/widgets/widget-tweaks.php' ); // Returns the correct sidebar region depending on the post/page/archive and theme settings require_once( get_template_directory() .'/functions/widgets/get-sidebar.php' ); // Returns the correct cropped or non-cropped featured image URLs - Requires that the AquaResizer is called first require_once( get_template_directory() .'/functions/featured-images.php'); // Outputs code in the tag for your favicons require_once( get_template_directory() .'/functions/favicon-apple-icons.php' ); // Outputs css for theme panel responsive width options require_once( get_template_directory() .'/functions/responsive-widths.php' ); // Outputs your tracking code in the tag require_once( get_template_directory() .'/functions/tracking-code.php' ); // Used to add CSS to the tag for your custom background settings require_once( get_template_directory() .'/functions/backgrounds.php' ); // Used to tweak the_excerpt() function and also defines the wpex_excerpt() function require_once( get_template_directory() .'/functions/excerpts.php' ); // Creates an array of font awesome icons for use in your theme require_once( get_template_directory() .'/functions/font-awesome.php'); // Built-in breadcrumbs function require_once( get_template_directory() .'/functions/breadcrumbs.php' ); // The main page title class - displays title/breadcrumbs/title backgrounds/subheading - etc. require_once( get_template_directory() .'/functions/page-header.php' ); // Pagination functions - default, infinite scroll and next/prev require_once( get_template_directory() .'/functions/pagination.php' ); // Next & Previous single post pagination require_once( get_template_directory() .'/functions/next-prev.php' ); // Outputs the post meta for blog posts & entries require_once( get_template_directory() .'/functions/post-meta.php' ); // Outputs the current post entry avatar require_once( get_template_directory() .'/functions/post-entry-author-avatar.php' ); // Used for the readmore links on standard posts require_once( get_template_directory() .'/functions/post-readmore-link.php' ); // Function used to alter the number of posts displayed for your custom post type archives require_once( get_template_directory() .'/functions/posts-per-page.php' ); // Comments callback function require_once( get_template_directory() .'/functions/comments-callback.php'); // Increase the quality of resized jpgs require_once( get_template_directory() .'/functions/better-jpgs.php' ); // Image cropping/resizing script require_once( get_template_directory() .'/functions/aqua-resizer.php' ); // Used to fix spacing issues with shortcodes require_once( get_template_directory() .'/functions/shortcodes-fix.php' ); // Used to display images defined by the gallery metabox function require_once( get_template_directory() .'/functions/meta/gallery-metabox/gmb-display.php' ); // Output social options as defined in the theme panel require_once( get_template_directory() .'/functions/social-output.php' ); // Used to display your post slider as defined in the wpex_post_slider meta value require_once( get_template_directory() .'/functions/page-slider.php' ); // Outputs the social sharing icons for posts and pages require_once( get_template_directory() .'/functions/social-share.php' ); // Alter the default output of the WordPress gallery shortcode if ( wpex_option( 'custom_wp_gallery', '1' ) == '1' ) { require_once( get_template_directory() .'/functions/wp-gallery.php'); } } // End else - is_admin() // Define the widget areas for this theme require_once( get_template_directory() .'/functions/widgets/widget-areas.php' ); // Custom widgets require_once( get_template_directory() .'/functions/widgets/widget-social.php' ); require_once( get_template_directory() .'/functions/widgets/widget-flickr.php' ); require_once( get_template_directory() .'/functions/widgets/widget-video.php' ); require_once( get_template_directory() .'/functions/widgets/widget-posts-thumbnails.php' ); require_once( get_template_directory() .'/functions/widgets/widget-recent-posts-thumb-grid.php' ); // Footer functions if ( !is_admin() ) { // Show/hide the main footer depending on current post meta require_once( get_template_directory() .'/functions/footer/footer-display.php' ); // Show/hide the footer callout depending on current post meta require_once( get_template_directory() .'/functions/footer/footer-callout.php' ); // The footer widgets require_once( get_template_directory() .'/functions/footer/footer-widgets.php' ); // Displays the copyright info in the footer require_once( get_template_directory() .'/functions/footer/footer-bottom.php' ); // Scroll to top link function require_once( get_template_directory() .'/functions/footer/scroll-top-link.php'); } // Function used for defining meta options require_once( get_template_directory() .'/functions/meta/usage.php'); // Meta fields for Standard Categories require_once( get_template_directory() .'/functions/meta/taxonomies/category-meta.php'); // Loads some js in the backend for showing/hiding meta settings require_once( get_template_directory() .'/functions/meta/display.php'); // A few small optimizations for speed - clean up the , remove useless jetpack scripts, etc. require_once( get_template_directory() .'/functions/optimizations.php'); /*------------------------------------------------*/ /* - Portfolio Post Type /*------------------------------------------------*/ if ( wpex_option( 'portfolio_enable', '1' ) == '1' ) { // Register the portfolio post type require_once( get_template_directory() .'/functions/register-posttypes-taxonomies/register-portfolio.php' ); // Displays an array of portfolio categories require_once( get_template_directory() .'/functions/portfolio/portfolio-categories.php' ); // Displays related portfolio items require_once( get_template_directory() .'/functions/portfolio/portfolio-related.php' ); } /*------------------------------------------------*/ /* - Post Series custom Taxonomy /*------------------------------------------------*/ if ( wpex_option( 'post_series', '1' ) == '1' ) { // Registers the post series custom taxonomy for the standard post type require_once( get_template_directory() .'/functions/register-posttypes-taxonomies/register-post-series.php' ); } require_once( get_template_directory() .'/functions/blog/post-series.php' ); /*------------------------------------------------*/ /* - Staff Post Type /*------------------------------------------------*/ if ( wpex_option( 'staff_enable', '1' ) == '1' ) { // Register the staff custom post type require_once( get_template_directory() .'/functions/register-posttypes-taxonomies/register-staff.php' ); } if ( ! is_admin() ) { // Used to display the social options for your staff members require_once( get_template_directory() .'/functions/staff/staff-social.php' ); // Staff entry image overlay require_once( get_template_directory() .'/functions/staff/staff-overlay.php' ); // Related staff posts require_once( get_template_directory() .'/functions/staff/staff-related.php' ); } /*------------------------------------------------*/ /* - Testimonials Post Type /*------------------------------------------------*/ if ( wpex_option( 'testimonials_enable', '1' ) == '1' ) { // Register the testimonials custom post type require_once( get_template_directory() .'/functions/register-posttypes-taxonomies/register-testimonials.php' ); } /*------------------------------------------------*/ /* - Custom Post Type & Taxonomy Functions /*------------------------------------------------*/ // Function used to alter your post type labels via theme options require_once( get_template_directory() .'/functions/register-posttypes-taxonomies/post-type-labels.php' ); // Function used to alter your taxonomy labels via theme options require_once( get_template_directory() .'/functions/register-posttypes-taxonomies/taxonomies-labels.php' ); // Tweak custom post types based on theme options require_once( get_template_directory() .'/functions/register-posttypes-taxonomies/tweak.php' ); /*------------------------------------------------*/ /* - WooCommerce /*------------------------------------------------*/ // WooCommerce specific functions if ( class_exists('Woocommerce') ) { if ( is_admin() ) { // Used to change the icon in the Woo menu items in WP 3.8+ require_once( get_template_directory() .'/functions/woocommerce/woo-dashicons.php' ); } if ( ! is_admin() ) { // Adds classes for the WooCommerce main layouts - sidebar, no sidebar, etc. require_once( get_template_directory() .'/functions/woocommerce/woo-layouts.php' ); // Remove Woo scripts require_once( get_template_directory() .'/functions/woocommerce/woo-scripts.php' ); // Remove the ajax add to cart button for the shop // require_once( get_template_directory() .'/functions/woocommerce/woo-remove-ajax-cart.php' ); // Change default Woo loop classes require_once( get_template_directory() .'/functions/woocommerce/woo-loop-classes.php' ); // Alter WooCommerce columns/pagination require_once( get_template_directory() .'/functions/woocommerce/woo-columns.php' ); // Change default Woo Image sizes require_once( get_template_directory() .'/functions/woocommerce/woo-images.php' ); // Product entry media - featured image / slider / image swap require_once( get_template_directory() .'/functions/woocommerce/woo-product-entry-media.php' ); // Overrides the default WooCommerce category image output require_once( get_template_directory() .'/functions/woocommerce/woo-category-image.php' ); // Overrides the default WooCommerce product featured image require_once( get_template_directory() .'/functions/woocommerce/woo-product-featured-image.php' ); // Overrides the default WooCommerce gallery thumbnails require_once( get_template_directory() .'/functions/woocommerce/woo-product-gallery-thumbs.php' ); // Remove Woo scripts require_once( get_template_directory() .'/functions/woocommerce/woo-scripts.php' ); // Remove the default Woo page title require_once( get_template_directory() .'/functions/woocommerce/woo-remove-page-title.php' ); // Display shopping cart $ in the nav if ( wpex_option( 'woo_menu_icon', '1' ) == '1' ) { require_once( get_template_directory() .'/functions/woocommerce/woo-menucart.php' ); } } // End if is admin } // Cart widget displays current cart items if ( ! is_admin() ) { require_once( get_template_directory() .'/functions/woocommerce/woo-cartwidget-overlay.php' ); require_once( get_template_directory() .'/functions/woocommerce/woo-cartwidget-dropdown.php' ); } /*------------------------------------------------*/ /* - Visual Composer Tweaks /*------------------------------------------------*/ // Set composer settings pages as settings page. if( function_exists('vc_set_as_theme') ) { // Set Visual Composer to run in Theme Mode vc_set_as_theme(true); // Run the Visual Composer Extension if ( function_exists('visual_composer_extension_run') ) { visual_composer_extension_run(); } // Remove certain default VC modules require_once( get_template_directory() .'/functions/visual-composer/remove.php' ); // Add new parameters to VC items require_once( get_template_directory() .'/functions/visual-composer/add-params.php' ); // Visual Composer Filter tweaks require_once( get_template_directory() .'/functions/visual-composer/filters.php' ); // Remove teaser metabox if ( is_admin() ) { function wpex_remove_meta_boxes() { if( !current_user_can('manage_options') ) { remove_meta_box('linktargetdiv', 'link', 'normal'); } // End privalages check } // End function add_action( 'admin_menu', 'wpex_remove_meta_boxes' ); } // Is admin check // Remove Visual Composer CSS add_action('wp_enqueue_scripts','wpex_remove_vcex_scripts'); if ( ! function_exists( 'wpex_remove_vcex_scripts' ) ) { function wpex_remove_vcex_scripts() { wp_deregister_style( 'vcex-lightbox' ); wp_deregister_style( 'vcex-font-awesome' ); } } } /*------------------------------------------------*/ /* - WP-Updates /*------------------------------------------------*/ // Get user envato license as provided in theme panel $wpex_envato_license_key = wpex_option( 'envato_license_key' ); // If envato license is defined load the auto update class and pass the license to it if ( $wpex_envato_license_key && wpex_option( 'enable_auto_updates', '0' ) == '1' ) { require_once( get_template_directory() .'/wp-updates-theme.php'); new WPUpdatesThemeUpdater_479( 'http://wp-updates.com/api/2/theme', basename(get_template_directory()), $wpex_envato_license_key ); }?> asbestos residential Archives - Chicago Asbestos | Chicago Asbestos