2013-10-08 09:06:32 -07:00
|
|
|
<?php
|
|
|
|
|
|
2013-11-07 14:15:57 -08:00
|
|
|
/**
|
2014-01-16 13:40:07 -08:00
|
|
|
* Trestle theme functionality
|
|
|
|
|
*
|
|
|
|
|
* @since 1.0.0
|
|
|
|
|
*
|
|
|
|
|
* @package Trestle
|
2013-11-07 14:15:57 -08:00
|
|
|
*/
|
2013-10-08 09:06:32 -07:00
|
|
|
|
2013-11-07 14:15:57 -08:00
|
|
|
add_action( 'genesis_setup' ,'trestle_theme_setup', 15 );
|
|
|
|
|
function trestle_theme_setup() {
|
2013-10-08 09:06:32 -07:00
|
|
|
|
2013-11-07 14:15:57 -08:00
|
|
|
/*===========================================
|
2014-01-16 13:40:07 -08:00
|
|
|
* Required Files
|
|
|
|
|
===========================================*/
|
|
|
|
|
|
|
|
|
|
// Trestle theme functions
|
|
|
|
|
require_once dirname( __FILE__ ) . '/lib/functions/theme-functions.php';
|
|
|
|
|
|
|
|
|
|
// Admin functionality
|
|
|
|
|
require_once dirname( __FILE__ ) . '/lib/admin/admin.php';
|
|
|
|
|
|
|
|
|
|
// Shortcodes
|
|
|
|
|
require_once dirname( __FILE__ ) . '/lib/shortcodes/shortcodes.php';
|
2014-04-28 09:09:49 -07:00
|
|
|
|
|
|
|
|
// Additional sidebars
|
|
|
|
|
require_once dirname( __FILE__ ) . '/lib/sidebars/sidebars.php';
|
2014-01-16 13:40:07 -08:00
|
|
|
|
|
|
|
|
// Plugin activation class
|
|
|
|
|
require_once dirname( __FILE__ ) . '/lib/classes/class-tgm-plugin-activation.php';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*===========================================
|
|
|
|
|
* Trestle Theme Setup
|
2013-11-07 14:15:57 -08:00
|
|
|
===========================================*/
|
2013-10-08 09:06:32 -07:00
|
|
|
|
2013-11-07 14:15:57 -08:00
|
|
|
// Child theme definitions (do not remove)
|
|
|
|
|
define( 'CHILD_THEME_NAME', 'Trestle' );
|
|
|
|
|
define( 'CHILD_THEME_URL', 'http://demo.mightyminnow.com/theme/trestle/' );
|
2014-01-16 13:40:07 -08:00
|
|
|
define( 'CHILD_THEME_VERSION', '1.0.0' );
|
2013-10-08 09:06:32 -07:00
|
|
|
|
2013-11-14 12:42:45 -08:00
|
|
|
// Load theme text domain
|
2014-01-16 13:40:07 -08:00
|
|
|
load_theme_textdomain( 'trestle', get_stylesheet_directory() . '/languages' );
|
2013-11-14 12:42:45 -08:00
|
|
|
|
2013-11-07 14:15:57 -08:00
|
|
|
// Add HTML5 markup structure
|
|
|
|
|
add_theme_support( 'html5' );
|
2013-10-08 09:06:32 -07:00
|
|
|
|
2013-11-07 14:15:57 -08:00
|
|
|
// Add viewport meta tag for mobile browsers
|
|
|
|
|
add_theme_support( 'genesis-responsive-viewport' );
|
2013-10-08 09:06:32 -07:00
|
|
|
|
2013-11-07 14:15:57 -08:00
|
|
|
// Add support for custom background
|
|
|
|
|
add_theme_support( 'custom-background' );
|
2013-10-08 09:06:32 -07:00
|
|
|
|
2014-01-16 13:40:07 -08:00
|
|
|
// Add support for footer widgets if specified in Trestle settings
|
|
|
|
|
$trestle_footer_widgets_number = esc_attr( genesis_get_option( 'trestle_footer_widgets_number' ) );
|
|
|
|
|
add_theme_support( 'genesis-footer-widgets', $trestle_footer_widgets_number );
|
2013-10-08 09:06:32 -07:00
|
|
|
|
|
|
|
|
|
2013-11-07 14:15:57 -08:00
|
|
|
/*===========================================
|
2014-05-08 13:41:17 -07:00
|
|
|
* Widget Areas
|
|
|
|
|
===========================================*/
|
|
|
|
|
|
|
|
|
|
add_action( 'widgets_init', 'trestle_register_widget_areas' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*===========================================
|
|
|
|
|
* Head Styles & Scripts
|
2013-11-07 14:15:57 -08:00
|
|
|
===========================================*/
|
2013-10-08 09:06:32 -07:00
|
|
|
|
2014-01-16 13:40:07 -08:00
|
|
|
add_action( 'wp_enqueue_scripts', 'trestle_header_actions' );
|
2013-10-08 09:06:32 -07:00
|
|
|
|
2014-02-13 09:33:55 -08:00
|
|
|
/*===========================================
|
2014-05-08 13:41:17 -07:00
|
|
|
* Body Classes
|
2014-02-13 09:33:55 -08:00
|
|
|
===========================================*/
|
2014-05-08 13:41:17 -07:00
|
|
|
|
|
|
|
|
add_filter( 'body_class', 'trestle_body_classes' );
|
|
|
|
|
|
|
|
|
|
/*===========================================
|
|
|
|
|
* Header
|
|
|
|
|
===========================================*/
|
|
|
|
|
|
|
|
|
|
// Add logo
|
|
|
|
|
add_filter( 'genesis_seo_title', 'trestle_do_logos', 10, 3 );
|
|
|
|
|
|
2013-10-08 09:06:32 -07:00
|
|
|
|
2013-11-07 14:15:57 -08:00
|
|
|
/*===========================================
|
|
|
|
|
* Auto & Mobile Navigation
|
|
|
|
|
===========================================*/
|
|
|
|
|
|
2013-11-14 14:26:55 -08:00
|
|
|
// Implement auto-nav and mobile nav button
|
2013-11-07 14:15:57 -08:00
|
|
|
add_action( 'init', 'trestle_nav_modifications' );
|
2013-10-08 09:06:32 -07:00
|
|
|
|
|
|
|
|
|
2013-11-07 14:15:57 -08:00
|
|
|
/*===========================================
|
2014-01-16 13:40:07 -08:00
|
|
|
* Posts & Pages
|
2013-11-07 14:15:57 -08:00
|
|
|
===========================================*/
|
2013-10-08 09:06:32 -07:00
|
|
|
|
2014-01-16 13:40:07 -08:00
|
|
|
// Setup revisions number
|
|
|
|
|
add_filter( 'wp_revisions_to_keep', 'trestle_update_revisions_number', 10, 2 );
|
2013-10-08 09:06:32 -07:00
|
|
|
|
2014-01-16 13:40:07 -08:00
|
|
|
// Manually control where Post Info & Meta display
|
2014-06-26 13:47:11 -07:00
|
|
|
add_action( 'the_post', 'trestle_post_info_meta', 5 );
|
2013-10-08 09:06:32 -07:00
|
|
|
|
2014-02-14 11:59:01 -08:00
|
|
|
// Remove default featured image fallback of 'first-attached'
|
|
|
|
|
add_filter( 'genesis_get_image_default_args', 'trestle_featured_image_fallback' );
|
|
|
|
|
|
2013-10-09 10:48:26 -07:00
|
|
|
|
2013-11-19 09:52:34 -08:00
|
|
|
/*===========================================
|
2014-01-16 13:40:07 -08:00
|
|
|
* General Actions & Filters
|
2013-11-19 09:52:34 -08:00
|
|
|
===========================================*/
|
|
|
|
|
|
2014-01-16 13:40:07 -08:00
|
|
|
// Do custom Read More text
|
|
|
|
|
add_filter( 'excerpt_more', 'trestle_read_more_link' );
|
|
|
|
|
add_filter( 'get_the_content_more_link', 'trestle_read_more_link' );
|
|
|
|
|
add_filter( 'the_content_more_link', 'trestle_read_more_link' );
|
2013-11-07 14:15:57 -08:00
|
|
|
}
|