Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //* Start the engine
- require_once( get_template_directory() . '/lib/init.php' );
- //* Child theme (do not remove)
- define( 'CHILD_THEME_NAME', 'Ally Theme', 'ally' );
- define( 'CHILD_THEME_URL', 'http://appfinite.com/themes/ally' );
- //* Enqueue Lato Google font
- add_action( 'wp_enqueue_scripts', 'genesis_sample_google_fonts' );
- function genesis_sample_google_fonts() {
- wp_enqueue_style( 'google-font', '//fonts.googleapis.com/css?family=Open+Sans:700,600,400,300', array(), PARENT_THEME_VERSION );
- }
- add_action( 'wp_enqueue_scripts', 'prefix_enqueue_awesome' );
- /**
- * Register and load font awesome
- * CSS files using a CDN.
- *
- * @link http://www.bootstrapcdn.com/#tab_fontawesome
- *
- */
- function prefix_enqueue_awesome() {
- wp_enqueue_style( 'prefix-font-awesome', '//netdna.bootstrapcdn.com/font-awesome/3.2.0/css/font-awesome.min.css', array(), '3.2.0' );
- }
- //* Add HTML5 markup structure
- add_theme_support( 'html5' );
- //* Add viewport meta tag for mobile browsers
- add_theme_support( 'genesis-responsive-viewport' );
- //* Add support for custom background
- add_theme_support( 'custom-background' );
- // Create additional color style options
- add_theme_support( 'genesis-style-selector', array(
- 'ally-light' => __( 'Light', 'ally' ),
- 'ally-dark' => __( 'Dark', 'ally' ),
- 'ally-blue' => __( 'Blue', 'ally' ),
- 'ally-green' => __( 'Green', 'ally' ),
- 'ally-lightblue' => __( 'Light Blue', 'ally' ),
- 'ally-orange' => __( 'Orange', 'ally' ),
- 'ally-pink' => __( 'Pink', 'ally' ),
- 'ally-purple' => __( 'Purple', 'ally' ),
- 'ally-red' => __( 'Red', 'ally' ),
- ) );
- // Add support for custom header
- add_theme_support( 'genesis-custom-header', array(
- 'width' => 320,
- 'height' => 80
- ) );
- // Add new image sizes
- add_image_size( 'featured-img', 640, 420, TRUE );
- add_image_size( 'featured-page', 312, 173, TRUE );
- add_image_size( 'portfolio-thumbnail', 264, 200, TRUE );
- // Add support for structural wraps
- add_theme_support( 'genesis-structural-wraps', array( 'header', 'nav', 'subnav', 'inner', 'footer-widgets', 'footer' ) );
- // Reposition the Secondary Navigation
- remove_action( 'genesis_after_header', 'genesis_do_subnav' ) ;
- add_action( 'genesis_before_header', 'genesis_do_subnav' );
- // Before Header Wrap
- add_action( 'genesis_before_header', 'before_header_wrap' );
- function before_header_wrap() {
- echo '<div class="head-wrap">';
- }
- // After Header Wrap
- add_action( 'genesis_after_header', 'after_header_wrap' );
- function after_header_wrap() {
- echo '</div>';
- }
- // Reposition the Primary Navigation
- remove_action( 'genesis_after_header', 'genesis_do_nav' ) ;
- add_action( 'genesis_after_header', 'genesis_do_nav', 2 );
- // Customize search form input box text
- add_filter( 'genesis_search_text', 'custom_search_text' );
- function custom_search_text($text) {
- return esc_attr( 'Search...' );
- }
- add_action( 'admin_menu', 'ally_theme_settings_init', 15 );
- /**
- * This is a necessary go-between to get our scripts and boxes loaded
- * on the theme settings page only, and not the rest of the admin
- */
- function ally_theme_settings_init() {
- global $_genesis_admin_settings;
- add_action( 'load-' . $_genesis_admin_settings->pagehook, 'ally_add_portfolio_settings_box', 20 );
- }
- // Add Portfolio Settings box to Genesis Theme Settings
- function ally_add_portfolio_settings_box() {
- global $_genesis_admin_settings;
- add_meta_box( 'genesis-theme-settings-ally-portfolio', __( 'Portfolio Page Settings', 'ally' ), 'ally_theme_settings_portfolio', $_genesis_admin_settings->pagehook, 'main' );
- }
- /**
- * Adds Portfolio Options to Genesis Theme Settings Page
- */
- function ally_theme_settings_portfolio() { ?>
- <p><?php _e("Display which category:", 'genesis'); ?>
- <?php wp_dropdown_categories(array('selected' => genesis_get_option('ally_portfolio_cat'), 'name' => GENESIS_SETTINGS_FIELD.'[ally_portfolio_cat]', 'orderby' => 'Name' , 'hierarchical' => 1, 'show_option_all' => __("All Categories", 'genesis'), 'hide_empty' => '0' )); ?></p>
- <p><?php _e("Exclude the following Category IDs:", 'genesis'); ?><br />
- <input type="text" name="<?php echo GENESIS_SETTINGS_FIELD; ?>[ally_portfolio_cat_exclude]" value="<?php echo esc_attr( genesis_get_option('ally_portfolio_cat_exclude') ); ?>" size="40" /><br />
- <small><strong><?php _e("Comma separated - 1,2,3 for example", 'genesis'); ?></strong></small></p>
- <p><?php _e('Number of Posts to Show', 'genesis'); ?>:
- <input type="text" name="<?php echo GENESIS_SETTINGS_FIELD; ?>[ally_portfolio_cat_num]" value="<?php echo esc_attr( genesis_option('ally_portfolio_cat_num') ); ?>" size="2" /></p>
- <p><span class="description"><?php _e('<b>NOTE:</b> The Portfolio Page displays the "Portfolio Page" image size plus the excerpt or full content as selected below.', 'ally'); ?></span></p>
- <p><?php _e("Select one of the following:", 'genesis'); ?>
- <select name="<?php echo GENESIS_SETTINGS_FIELD; ?>[ally_portfolio_content]">
- <option style="padding-right:10px;" value="full" <?php selected('full', genesis_get_option('ally_portfolio_content')); ?>><?php _e("Display post content", 'genesis'); ?></option>
- <option style="padding-right:10px;" value="excerpts" <?php selected('excerpts', genesis_get_option('ally_portfolio_content')); ?>><?php _e("Display post excerpts", 'genesis'); ?></option>
- </select></p>
- <p><label for="<?php echo GENESIS_SETTINGS_FIELD; ?>[ally_portfolio_content_archive_limit]"><?php _e('Limit content to', 'genesis'); ?></label> <input type="text" name="<?php echo GENESIS_SETTINGS_FIELD; ?>[ally_portfolio_content_archive_limit]" id="<?php echo GENESIS_SETTINGS_FIELD; ?>[ally_portfolio_content_archive_limit]" value="<?php echo esc_attr( genesis_option('ally_portfolio_content_archive_limit') ); ?>" size="3" /> <label for="<?php echo GENESIS_SETTINGS_FIELD; ?>[ally_portfolio_content_archive_limit]"><?php _e('characters', 'genesis'); ?></label></p>
- <p><span class="description"><?php _e('<b>NOTE:</b> Using this option will limit the text and strip all formatting from the text displayed. To use this option, choose "Display post content" in the select box above.', 'genesis'); ?></span></p>
- <?php
- }
- //* Add support for 3-column footer widgets
- add_theme_support( 'genesis-footer-widgets', 3 );
- /** Register widget areas */
- genesis_register_sidebar( array(
- 'id' => 'slider-wide',
- 'name' => __( 'Slider Wide', 'ally' ),
- 'description' => __( 'This is the wide full width slider section of the homepage.', 'ally' ),
- ) );
- genesis_register_sidebar( array(
- 'id' => 'slider',
- 'name' => __( 'Slider', 'ally' ),
- 'description' => __( 'This is the slider section of the homepage.', 'ally' ),
- ) );
- genesis_register_sidebar( array(
- 'id' => 'welcome',
- 'name' => __( 'Welcome', 'ally' ),
- 'description' => __( 'This is the welcome section of the homepage.', 'ally' ),
- ) );
- genesis_register_sidebar( array(
- 'id' => 'home-feature-1',
- 'name' => __( 'Home Feature#1', 'ally' ),
- 'description' => __( 'This is the first column of the feature section of the homepage.', 'ally' ),
- ) );
- genesis_register_sidebar( array(
- 'id' => 'home-feature-2',
- 'name' => __( 'Home Feature#2', 'ally' ),
- 'description' => __( 'This is the second column of the feature section of the homepage.', 'ally' ),
- ) );
- genesis_register_sidebar( array(
- 'id' => 'home-feature-3',
- 'name' => __( 'Home Feature#3', 'ally' ),
- 'description' => __( 'This is the 3rd column of the feature section of the homepage.', 'ally' ),
- ) );
- genesis_register_sidebar( array(
- 'id' => 'home-middle-wide',
- 'name' => __( 'Home Middle Wide', 'ally' ),
- 'description' => __( 'This is the middle wide section of the homepage.', 'ally' ),
- ) );
- genesis_register_sidebar( array(
- 'id' => 'home-middle-1',
- 'name' => __( 'Home Middle 1', 'ally' ),
- 'description' => __( 'This is the first sidebar of the middle section of the homepage.', 'ally' ),
- ) );
- genesis_register_sidebar( array(
- 'id' => 'home-middle-2',
- 'name' => __( 'Home Middle 2', 'ally' ),
- 'description' => __( 'This is the second sidebar of the middle section of the homepage.', 'ally' ),
- ) );
- genesis_register_sidebar( array(
- 'id' => 'home-middle-3-wide',
- 'name' => __( 'Home Middle 3 Wide', 'ally' ),
- 'description' => __( 'This is the wide middle section of the homepage.', 'ally' ),
- ) );
- genesis_register_sidebar( array(
- 'id' => 'home-middle-4',
- 'name' => __( 'Home Middle 4', 'ally' ),
- 'description' => __( 'This is the fourth sidebar of the middle section of the homepage.', 'ally' ),
- ) );
- genesis_register_sidebar( array(
- 'id' => 'home-middle-5',
- 'name' => __( 'Home Middle 5', 'ally' ),
- 'description' => __( 'This is the fifth sidebar of the middle feature section of the homepage.', 'ally' ),
- ) );
- genesis_register_sidebar( array(
- 'id' => 'home-bottom-1',
- 'name' => __( 'Home Bottom 1', 'ally' ),
- 'description' => __( 'This is the first sidebar of the bottom section of the homepage.', 'ally' ),
- ) );
- genesis_register_sidebar( array(
- 'id' => 'home-bottom-2',
- 'name' => __( 'Home Bottom 2', 'ally' ),
- 'description' => __( 'This is the second sidebar of the bottom section of the homepage.', 'ally' ),
- ) );
- genesis_register_sidebar( array(
- 'id' => 'home-bottom-3',
- 'name' => __( 'Home Bottom 3', 'ally' ),
- 'description' => __( 'This is the third sidebar of the bottom section of the homepage.', 'ally' ),
- ) );
- genesis_register_sidebar( array(
- 'id' => 'home-bottom-4',
- 'name' => __( 'Home Bottom 4', 'ally' ),
- 'description' => __( 'This is the fourth sidebar of the bottom section of the homepage.', 'ally' ),
- ) );
- genesis_register_sidebar( array(
- 'id' => 'home-bottom-wide',
- 'name' => __( 'Home Bottom Wide', 'ally' ),
- 'description' => __( 'This is the very bottom section of the homepage.', 'ally' ),
- ) );
- //* Display author box on single posts
- add_filter( 'get_the_author_genesis_author_box_single', '__return_true' );
- //* Modify the size of the Gravatar in the author box
- add_filter( 'genesis_author_box_gravatar_size', 'author_box_gravatar_size' );
- function author_box_gravatar_size( $size ) {
- return '120';
- }
- //* Register newsletter widget area
- genesis_register_sidebar( array(
- 'id' => 'newsletter',
- 'name' => __( 'Newsletter', 'custom-theme' ),
- 'description' => __( 'This is the newsletter section.', 'custom-theme' ),
- ) );
- //* Add the newsletter widget after the post content
- add_action( 'genesis_entry_footer', 'custom_add_newsletter_box' );
- function custom_add_newsletter_box() {
- if ( is_singular( 'post' ) )
- genesis_widget_area( 'newsletter', array(
- 'before' => '<div id="newsletter">',
- ) );
- }
- //* Add Jetpack share buttons above post
- remove_filter( 'the_content', 'sharing_display', 19 );
- remove_filter( 'the_excerpt', 'sharing_display', 19 );
- add_filter( 'the_content', 'sp_share_buttons_above_post', 19 );
- add_filter( 'the_excerpt', 'sp_share_buttons_above_post', 19 );
- function sp_share_buttons_above_post( $content = '' ) {
- if ( function_exists( 'sharing_display' ) ) {
- return sharing_display() . $content;
- }
- else {
- return $content;
- }
- }
- remove_action( 'genesis_after_post_content', 'genesis_post_meta' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement