Files
trestle/functions.php
T

101 lines
2.8 KiB
PHP
Raw Normal View History

2013-10-08 09:06:32 -07:00
<?php
/**
* Genesis Theme Setup
* @since 1.0
*
* This setup function attaches all theme functionality
* via the appropriate hooks and filters and includes
* additional theme files
*/
2013-10-08 09:06:32 -07:00
add_action( 'genesis_setup' ,'trestle_theme_setup', 15 );
function trestle_theme_setup() {
2013-10-08 09:06:32 -07:00
/*===========================================
* Trestle theme settings
===========================================*/
2013-10-08 09:06:32 -07:00
// Child theme definitions (do not remove)
define( 'CHILD_THEME_NAME', 'Trestle' );
define( 'CHILD_THEME_URL', 'http://demo.mightyminnow.com/theme/trestle/' );
define( 'CHILD_THEME_VERSION', '1.0' );
2013-10-08 09:06:32 -07:00
// Load theme text domain
load_theme_textdomain( 'trestle', get_template_directory() . '/languages');
// Add HTML5 markup structure
add_theme_support( 'html5' );
2013-10-08 09:06:32 -07:00
// Add viewport meta tag for mobile browsers
add_theme_support( 'genesis-responsive-viewport' );
2013-10-08 09:06:32 -07:00
// Add support for custom background
add_theme_support( 'custom-background' );
2013-10-08 09:06:32 -07:00
// Add support for 3-column footer widgets
add_theme_support( 'genesis-footer-widgets', 3 );
2013-10-08 09:06:32 -07:00
/*===========================================
* Required Files
===========================================*/
// Trestle theme functions
require_once dirname( __FILE__ ) . '/lib/functions/trestle-functions.php';
2013-10-08 09:06:32 -07:00
// Admin functionality
require_once dirname( __FILE__ ) . '/lib/admin/admin.php';
// Plugin activation class
require_once dirname( __FILE__ ) . '/lib/classes/class-tgm-plugin-activation.php';
2013-10-08 09:06:32 -07:00
/*===========================================
* Styles and scripts
===========================================*/
2013-10-08 09:06:32 -07:00
add_action( 'wp_enqueue_scripts', 'trestle_header_actions');
/*===========================================
* Admin styles and scripts
===========================================*/
add_action( 'init', 'trestle_admin_actions' );
2013-10-08 09:06:32 -07:00
/*===========================================
* Load Required/Suggested Plugins
*
* Utilizes TGM Plugin Activation class:
* https://github.com/thomasgriffin/TGM-Plugin-Activation
===========================================*/
add_action( 'tgmpa_register', 'trestle_register_required_plugins' );
2013-10-08 09:06:32 -07:00
/*===========================================
* Auto & Mobile Navigation
===========================================*/
// Implement auto-nav and mobile nav button
add_action( 'init', 'trestle_nav_modifications' );
2013-10-08 09:06:32 -07:00
/*===========================================
* Actions & Filters
===========================================*/
2013-10-08 09:06:32 -07:00
// Add jquery class to body for styling nav if jQuery isn't enabled (jQuery will remove this class if enabled)
add_filter('body_class','no_jquery');
2013-10-08 09:06:32 -07:00
/*===========================================
* Footer
===========================================*/
// Add Trestle custom footer attribute to Mm
add_filter( 'genesis_footer_output', 'trestle_custom_footer' );
}