Skip to content

Instantly share code, notes, and snippets.

@hellofromtonya
Created March 5, 2019 23:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hellofromtonya/aacecb4574c1e827de4253c0a44b7a9f to your computer and use it in GitHub Desktop.
Save hellofromtonya/aacecb4574c1e827de4253c0a44b7a9f to your computer and use it in GitHub Desktop.
Example of unnecessarily calling get_template_directory() over and over again.
<?php
// Start the engine.
include_once( get_template_directory() . '/lib/init.php' );
// Setup Theme.
include_once( get_stylesheet_directory() . '/lib/theme-defaults.php' );
// Set Localization (do not remove).
add_action( 'after_setup_theme', 'altitude_localization_setup' );
function altitude_localization_setup(){
load_child_theme_textdomain( 'altitude-pro', get_stylesheet_directory() . '/languages' );
}
// Add the theme helper functions.
include_once( get_stylesheet_directory() . '/lib/helper-functions.php' );
// Add Image upload and Color select to WordPress Theme Customizer.
require_once( get_stylesheet_directory() . '/lib/customize.php' );
// Include Customizer CSS.
include_once( get_stylesheet_directory() . '/lib/output.php' );
// Include the WooCommerce setup functions.
include_once( get_stylesheet_directory() . '/lib/woocommerce/woocommerce-setup.php' );
// Include the WooCommerce custom CSS if customized.
include_once( get_stylesheet_directory() . '/lib/woocommerce/woocommerce-output.php' );
// Include notice to install Genesis Connect for WooCommerce.
include_once( get_stylesheet_directory() . '/lib/woocommerce/woocommerce-notice.php' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment