Files
trestle/functions.php
T

113 lines
3.2 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_stylesheet_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');
/*===========================================
* 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
// Create / remove placeholder menu for Trestle auto nav
add_action( 'init', 'trestle_nav_placeholder' );
2013-10-08 09:06:32 -07:00
/*===========================================
* Actions & Filters
===========================================*/
2013-10-08 09:06:32 -07:00
// Add body classes
add_filter( 'body_class', 'trestle_body_classes' );
2013-10-08 09:06:32 -07:00
/*===========================================
* Footer
===========================================*/
// Add Trestle custom footer attribute to Mm
add_filter( 'genesis_footer_output', 'trestle_custom_footer' );
/*===========================================
* Admin Functionality
===========================================*/
// Trestle admin scripts and styles
add_action( 'admin_enqueue_scripts', 'trestle_admin_actions' );
// Trestle default settings
add_filter( 'genesis_theme_settings_defaults', 'trestle_custom_defaults' );
// Sanitize settings
add_action( 'genesis_settings_sanitizer_init', 'trestle_register_social_sanitization_filters' );
// Register Trestle settings metabox
add_action( 'genesis_theme_settings_metaboxes', 'trestle_register_settings_box' );
}