'.site-title a', 'header-text' => false, 'height' => 80, 'width' => 320, ) ); //* Add support for additional color style options add_theme_support( 'genesis-style-selector', array( 'enterprise-pro-black' => __( 'Enterprise Pro Black', 'enterprise' ), 'enterprise-pro-green' => __( 'Enterprise Pro Green', 'enterprise' ), 'enterprise-pro-orange' => __( 'Enterprise Pro Orange', 'enterprise' ), 'enterprise-pro-red' => __( 'Enterprise Pro Red', 'enterprise' ), 'enterprise-pro-teal' => __( 'Enterprise Pro Teal', 'enterprise' ), ) ); //* Add support for structural wraps add_theme_support( 'genesis-structural-wraps', array( 'header', 'nav', 'subnav', 'site-inner', 'footer-widgets', 'footer', ) ); //* Reposition the secondary navigation menu remove_action( 'genesis_after_header', 'genesis_do_subnav' ); add_action( 'genesis_footer', 'genesis_do_subnav', 7 ); //* Reduce the secondary navigation menu to one level depth add_filter( 'wp_nav_menu_args', 'enterprise_secondary_menu_args' ); function enterprise_secondary_menu_args( $args ){ if( 'secondary' != $args['theme_location'] ) return $args; $args['depth'] = 1; return $args; } //* Remove comment form allowed tags add_filter( 'comment_form_defaults', 'enterprise_remove_comment_form_allowed_tags' ); function enterprise_remove_comment_form_allowed_tags( $defaults ) { $defaults['comment_notes_after'] = ''; return $defaults; } //* Add support for 3-column footer widgets add_theme_support( 'genesis-footer-widgets', 3 ); //* Add support for after entry widget add_theme_support( 'genesis-after-entry-widget-area' ); //* Relocate after entry widget remove_action( 'genesis_after_entry', 'genesis_after_entry_widget_area' ); add_action( 'genesis_after_entry', 'genesis_after_entry_widget_area', 5 ); //* Register widget areas genesis_register_sidebar( array( 'id' => 'home-top', 'name' => __( 'Home - Top', 'enterprise' ), 'description' => __( 'This is the top section of the homepage.', 'enterprise' ), ) ); genesis_register_sidebar( array( 'id' => 'home-intro', 'name' => __( 'Home - Intro', 'enterprise' ), 'description' => __( 'This is the second top section of the homepage.', 'enterprise' ), ) ); genesis_register_sidebar( array( 'id' => 'home-projects', 'name' => __( 'Home - Projects', 'enterprise' ), 'description' => __( 'This is the third top section of the homepage.', 'enterprise' ), ) ); genesis_register_sidebar( array( 'id' => 'home-bottom', 'name' => __( 'Home - Bottom', 'enterprise' ), 'description' => __( 'This is the bottom section of the homepage.', 'enterprise' ), ) ); genesis_register_sidebar( array( 'id' => 'home-bottom-1', 'name' => __( 'Home - Bottom 1', 'enterprise' ), 'description' => __( 'This is the bottom section of the homepage.', 'enterprise' ), ) ); genesis_register_sidebar( array( 'id' => 'home-bottom-2', 'name' => __( 'Home - Bottom 2', 'enterprise' ), 'description' => __( 'This is the bottom section of the homepage.', 'enterprise' ), ) ); //* Customize the credits add_filter( 'genesis_footer_creds_text', 'sp_footer_creds_text' ); function sp_footer_creds_text() { echo '
'; echo 'Copyright © '; echo date('Y'); echo ' United Nations Alliance of Civilizations (UNAOC) | 730 Third Avenue, 20th Floor, New York, NY 10017'; echo ' | Privacy | Terms '; echo '
'html', 'size' => genesis_get_option( 'image_size' ), 'attr' => array( 'class' => 'post-image alignright' ) ) );
printf( '%s', get_permalink(), the_title_attribute( 'echo=0' ), $img );
}
//* Display author box on single posts
add_filter( 'get_the_author_genesis_author_box_single', '__return_true' );
//* Remove Author Box Conditionally
add_action( 'template_redirect', 'remove_authorbox_conditionally' );
/**
* @author Brad Dalton
* @example http://wpsites.net/
* @copyright 2014 WP Sites
*/
function remove_authorbox_conditionally(){
if( in_category('service-ratings') || in_category('testimonials') || in_category('careers') || in_category('downloads') ) {
remove_action( 'genesis_after_entry', 'genesis_do_author_box_single', 8 );
}
}
//* Customize the post info function
add_filter( 'genesis_post_info', 'sp_post_info_filter' );
function sp_post_info_filter($post_info) {
if ( !is_page() ) {
$post_info = '[post_date], [post_categories]';
return $post_info;
}}
add_filter( 'wp_nav_menu_items', 'theme_menu_extras', 10, 2 );
/**
* Filter menu items, appending either a search form or today's date.
*
* @param string $menu HTML string of list items.
* @param stdClass $args Menu arguments.
*
* @return string Amended HTML string of list items.
*/
function theme_menu_extras( $menu, $args ) {
//* Change 'primary' to 'secondary' to add extras to the secondary navigation menu
if ( 'primary' !== $args->theme_location )
return $menu;
//* Uncomment this block to add a search form to the navigation menu
ob_start();
get_search_form();
$search = ob_get_clean();
$menu .= 'tags */ //remove_filter('the_content', 'wpautop'); //* Create custom category archive widget area genesis_register_sidebar( array( 'id' => 'category-widget', 'name' => __( 'Category Page Widget', 'education' ), 'description' => __( 'This is the widget section of category pages.', 'education' ), ) ); //* Hook category widget area before post content add_action( 'genesis_after_content', 'education_category_archive_widget' ); function education_category_archive_widget() { if ( is_category('business-start-up' ) ) genesis_widget_area( 'category-widget', array( 'before' => '
', ) ); } //* Remove the author box on single posts XHTML Themes remove_action( 'genesis_after_post', 'genesis_do_author_box_single' ); //* Remove the author box on single posts HTML5 Themes remove_action( 'genesis_after_entry', 'genesis_do_author_box_single', 8 ); //* Reposition the breadcrumbs remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' ); add_action( 'genesis_after_header', 'genesis_do_breadcrumbs' ); //* Modify breadcrumb arguments. add_filter( 'genesis_breadcrumb_args', 'sp_breadcrumb_args' ); function sp_breadcrumb_args( $args ) { $args['home'] = 'Home'; $args['sep'] = ' » '; $args['list_sep'] = ', '; // Genesis 1.5 and later $args['prefix'] = ''; $args['heirarchial_attachments'] = true; // Genesis 1.5 and later $args['heirarchial_categories'] = true; // Genesis 1.5 and later $args['display'] = true; $args['labels']['prefix'] = 'You are here: '; $args['labels']['author'] = 'Archives for '; $args['labels']['category'] = 'Archives for '; // Genesis 1.6 and later $args['labels']['tag'] = 'Archives for '; $args['labels']['date'] = 'Archives for '; $args['labels']['search'] = 'Search for '; $args['labels']['tax'] = 'Archives for '; $args['labels']['post_type'] = 'Archives for '; $args['labels']['404'] = 'Not found: '; // Genesis 1.5 and later return $args; } /*---------------------------------------------------------------*/ /* Set Custom Layouts /*---------------------------------------------------------------*/ /*add_filter('genesis_pre_get_option_site_layout', 'set_layouts'); function set_layouts($layout) { if ( tribe_is_month() ) { $layout = 'full-width-content'; } return $layout; }*/ /** * The Events Calendar - Bypass Genesis genesis_do_post_content in Event Views * This snippet overrides the Genesis Content Archive settings for Event Views * Event Template set to: Admin > Events > Settings > Display Tab > Events template > Default Page Template * The Events Calendar @4.0.4 * Genesis @2.2.6 */ add_action( 'get_header', 'tribe_genesis_bypass_genesis_do_post_content' ); function tribe_genesis_bypass_genesis_do_post_content() { if ( class_exists( 'Tribe__Events__Main' ) && class_exists( 'Tribe__Events__Pro__Main' ) ) { if ( tribe_is_month() || tribe_is_upcoming() || tribe_is_past() || tribe_is_day() || tribe_is_map() || tribe_is_photo() || tribe_is_week() || ( tribe_is_recurring_event() && ! is_singular( 'tribe_events' ) ) ) { remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 ); remove_action( 'genesis_entry_content', 'genesis_do_post_content' ); add_action( 'genesis_entry_content', 'the_content', 15 ); } } elseif ( class_exists( 'Tribe__Events__Main' ) && ! class_exists( 'Tribe__Events__Pro__Main' ) ) { if ( tribe_is_month() || tribe_is_upcoming() || tribe_is_past() || tribe_is_day() ) { remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 ); remove_action( 'genesis_entry_content', 'genesis_do_post_content' ); add_action( 'genesis_entry_content', 'the_content', 15 ); } } } /* Allows visitors to page forward/backwards in any direction within month view an "infinite" number of times - Fix missing previous month link -Julie */ if ( class_exists( 'Tribe__Events__Main' ) ) { class ContinualMonthViewPagination { public function __construct() { add_filter( 'tribe_events_the_next_month_link', array( $this, 'next_month' ) ); add_filter( 'tribe_events_the_previous_month_link', array( $this, 'previous_month' ) ); } public function next_month() { $url = tribe_get_next_month_link(); $text = tribe_get_next_month_text(); $date = Tribe__Events__Main::instance()->nextMonth( tribe_get_month_view_date() ); return '' . $text . ' »'; } public function previous_month() { $url = tribe_get_previous_month_link(); $text = tribe_get_previous_month_text(); $date = Tribe__Events__Main::instance()->previousMonth( tribe_get_month_view_date() ); return '« ' . $text . ' '; } } new ContinualMonthViewPagination; } /* //* 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; } } */ /* Register Custom Post Types from Old Website */ add_action( 'init', 'create_custom_post_type' ); function create_custom_post_type() { $labels = array ( 'name' => __( 'Group of Friends' ), 'singular_name' => __( 'Group of Friends Member' ) ); $args = array( 'labels' => $labels, 'public' => true, 'has_archive' => true, 'rewrite' => array('slug' => 'group-of-friends'), ); register_post_type( 'gof-member', $args); } add_action( 'init', 'create_custom_post_type_one' ); function create_custom_post_type_one() { $labels = array ( 'name' => __( 'PeaceApp Blog' ), 'singular_name' => __( 'PeaceApp Blog' ) ); $args = array( 'labels' => $labels, 'public' => true, 'has_archive' => true, 'rewrite' => array('slug' => 'peaceapp-blog'), ); register_post_type( 'peaceapp-blog', $args); } add_action( 'init', 'create_custom_post_type_two' ); function create_custom_post_type_two() { $labels = array ( 'name' => __( 'UNAOC in the News' ), 'singular_name' => __( 'UNAOC in the News' ) ); $args = array( 'labels' => $labels, 'public' => true, 'has_archive' => true, 'rewrite' => array('slug' => 'unaoc-in-the-news'), 'supports' => array( 'title', 'editor', 'custom-fields', 'category', 'thumbnail', 'genesis-cpt-archives-settings' ), ); register_post_type( 'unaoc-in-the-news', $args); } add_action( 'init', 'create_custom_post_type_three' ); function create_custom_post_type_three() { $labels = array ( 'name' => __( 'Documents' ), 'singular_name' => __( 'Documents' ) ); $args = array( 'labels' => $labels, 'public' => true, 'has_archive' => true, 'rewrite' => array('slug' => 'documents'), ); register_post_type( 'document', $args); } add_action( 'init', 'create_custom_post_type_four' ); function create_custom_post_type_four() { $labels = array ( 'name' => __( 'HR Events' ), 'singular_name' => __( 'HR Event' ) ); $args = array( 'labels' => $labels, 'public' => true, 'has_archive' => true, 'rewrite' => array('slug' => 'hr-events'), 'supports' => array( 'title', 'editor', 'custom-fields' ) ); register_post_type( 'hr-events', $args); } add_action( 'init', 'create_custom_post_type_five' ); function create_custom_post_type_five() { $labels = array ( 'name' => __( 'Resources and Publications' ), 'singular_name' => __( 'Resources and Publications' ) ); $args = array( 'labels' => $labels, 'public' => true, 'has_archive' => true, 'rewrite' => array('slug' => 'resource'), //must be distinct from resources with an S 'supports' => array( 'title', 'editor', 'custom-fields', 'category', 'thumbnail', 'genesis-cpt-archives-settings' ) ); register_post_type( 'resource', $args); } /* add_action('init','add_categories_to_resource'); function add_categories_to_resource(){ //register_taxonomy_for_object_type('doc-category', 'resource'); register_taxonomy( 'doccategory', 'resource', $args ); }*/ // hook into the init action and call create_resource_taxonomies when it fires add_action( 'init', 'create_resource_taxonomies', 0 ); // create two taxonomies, type and year for the post type "resource" function create_resource_taxonomies() { // Add new taxonomy, make it hierarchical (like categories) $labels = array( 'name' => _x( 'Resource Type', 'taxonomy general name' ), 'singular_name' => _x( 'Resource Type', 'taxonomy singular name' ), 'search_items' => __( 'Search Resource Type' ), 'all_items' => __( 'All Resource Types' ), 'parent_item' => __( 'Parent Resource' ), 'parent_item_colon' => __( 'Parent Resource:' ), 'edit_item' => __( 'Edit Resource Type' ), 'update_item' => __( 'Update Resource Type' ), 'add_new_item' => __( 'Add New Resource Type' ), 'new_item_name' => __( 'New Resource Type Name' ), 'menu_name' => __( 'Resource Type' ), ); $args = array( 'hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'show_admin_column' => true, 'query_var' => true, 'rewrite' => array( 'slug' => 'resource-type' ), ); register_taxonomy( 'resource-type', array( 'resource' ), $args ); // Add new taxonomy, NOT hierarchical (like tags) $labels = array( 'name' => _x( 'Year', 'taxonomy general name' ), 'singular_name' => _x( 'Year', 'taxonomy singular name' ), 'search_items' => __( 'Search Year' ), 'popular_items' => __( 'Popular Year' ), 'all_items' => __( 'All Entries by Year' ), 'parent_item' => null, 'parent_item_colon' => null, 'edit_item' => __( 'Edit Year' ), 'update_item' => __( 'Update Year' ), 'add_new_item' => __( 'Add New Year' ), 'new_item_name' => __( 'New Year' ), 'separate_items_with_commas' => __( 'Separate year with commas' ), 'add_or_remove_items' => __( 'Add or remove year' ), 'choose_from_most_used' => __( 'Choose from the most used year' ), 'not_found' => __( 'No document year found.' ), 'menu_name' => __( 'Year' ), ); $args = array( 'hierarchical' => false, 'labels' => $labels, 'show_ui' => true, 'show_admin_column' => true, 'update_count_callback' => '_update_post_term_count', 'query_var' => true, 'rewrite' => array( 'slug' => 'doc-year' ), ); register_taxonomy( 'doc-year', 'resource', $args ); } /* add Genesis layout options to custom posts types */ add_post_type_support( 'resource', 'genesis-layouts' ); // create custom post type for YSF winners add_action( 'init', 'create_custom_post_type_six' ); function create_custom_post_type_six() { $labels = array ( 'name' => __( 'YSF Winners' ), 'singular_name' => __( 'YSF Winner' ) ); $args = array( 'labels' => $labels, 'public' => true, 'has_archive' => true, 'rewrite' => array('slug' => 'ysf-winner'), //must be distinct from resources with an S 'supports' => array( 'title', 'editor', 'custom-fields', 'category', 'thumbnail', 'genesis-cpt-archives-settings' ) ); register_post_type( 'ysf-winners', $args); } // hook into the init action and call create_resource_taxonomies when it fires add_action( 'init', 'create_ysf_taxonomies', 0 ); // create ysf_year taxonomy for YSF Winners function create_ysf_taxonomies() { // Add new taxonomy, make it hierarchical (like categories) $labels = array( 'name' => _x( 'YSF Year', 'taxonomy general name' ), 'singular_name' => _x( 'YSF Year', 'taxonomy singular name' ), 'search_items' => __( 'Search YSF Year' ), 'all_items' => __( 'All YSF Years' ), 'edit_item' => __( 'Edit YSF Year' ), 'update_item' => __( 'Update YSF Year' ), 'add_new_item' => __( 'Add New YSF Year' ), 'new_item_name' => __( 'New YSF Year' ), 'menu_name' => __( 'YSF Year' ), ); $args = array( 'hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'show_admin_column' => true, 'query_var' => true, 'rewrite' => array( 'slug' => 'ysf-year' ), ); register_taxonomy( 'ysf-year', array( 'ysf-winners' ), $args ); } /* add Genesis layout options to custom posts types */ add_post_type_support( 'resource', 'genesis-layouts' ); //* Remove the entry meta in the entry footer (requires HTML5 theme support) remove_action( 'genesis_entry_footer', 'genesis_post_meta' ); /** Add Post image above post title, single posts only */ add_action( 'genesis_before_post', 'agency_post_image' ); function agency_post_image() { if ( is_single() ) return; if ( $image = genesis_get_image( 'format=url&size=post-image' ) ) { printf( '