Files
trestle/functions.php
T

117 lines
3.4 KiB
PHP
Raw Normal View History

2013-10-08 09:06:32 -07:00
<?php
/**
* Trestle theme functionality
*
* @since 1.0.0
*
* @package Trestle
*/
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
/*===========================================
* 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';
// Additional sidebars
require_once dirname( __FILE__ ) . '/lib/sidebars/sidebars.php';
// Plugin activation class
require_once dirname( __FILE__ ) . '/lib/classes/class-tgm-plugin-activation.php';
/*===========================================
* Trestle Theme Setup
===========================================*/
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.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 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
/*===========================================
2014-05-08 13:41:17 -07:00
* Widget Areas
===========================================*/
add_action( 'widgets_init', 'trestle_register_widget_areas' );
/*===========================================
* Head Styles & Scripts
===========================================*/
2013-10-08 09:06:32 -07:00
add_action( 'wp_enqueue_scripts', 'trestle_header_actions' );
2013-10-08 09:06:32 -07:00
/*===========================================
2014-05-08 13:41:17 -07:00
* Body Classes
===========================================*/
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
/*===========================================
* Auto & Mobile Navigation
===========================================*/
// Implement auto-nav and mobile nav button
add_action( 'init', 'trestle_nav_modifications' );
2013-10-08 09:06:32 -07:00
/*===========================================
* Posts & Pages
===========================================*/
2013-10-08 09:06:32 -07:00
// Setup revisions number
add_filter( 'wp_revisions_to_keep', 'trestle_update_revisions_number', 10, 2 );
2013-10-08 09:06:32 -07:00
// Manually control where Post Info & Meta display
add_action( 'the_post', 'trestle_post_info_meta', 5 );
2013-10-08 09:06:32 -07:00
// Remove default featured image fallback of 'first-attached'
add_filter( 'genesis_get_image_default_args', 'trestle_featured_image_fallback' );
/*===========================================
* General Actions & Filters
===========================================*/
// 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' );
}