'Slides', 'singular_name' => 'Slide', 'menu_name' => 'Slides', 'parent_item_colon' => '', 'all_items' => 'Slides', 'view_item' => 'View Slide', 'add_new_item' => 'Add New Slide', 'add_new' => 'Add New Slide', 'edit_item' => 'Edit Slide', 'update_item' => 'Update Slide', 'search_items' => 'Search Slides', 'not_found' => 'Not Found', 'not_found_in_trash' => 'No Slides in Trash', ); $args = array( 'label' => 'slideshow', 'description' => 'Slides that may be used, via shortcode, to create rotating images or content anywhere on the site.', 'labels' => $labels, 'supports' => array( 'title', 'editor', 'thumbnail', 'revisions', ), 'taxonomies' => array( 'slide_set' ), 'hierarchical' => false, 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => false, 'show_in_admin_bar' => true, 'menu_position' => 20, 'menu_icon' => '', 'can_export' => true, 'has_archive' => false, 'exclude_from_search' => true, 'publicly_queryable' => true, 'capability_type' => 'page', ); register_post_type( 'slideshow', $args ); //ADD SLIDE SET TAXONOMY $labels = array( 'name' => 'Slide Sets', 'singular_name' => 'Slide Set', 'menu_name' => 'Slide Set', 'all_items' => 'Slide Sets', 'parent_item' => '', 'parent_item_colon' => '', 'new_item_name' => 'New Slide Set', 'add_new_item' => 'Add Slide Set', 'edit_item' => 'Edit Slide Set', 'update_item' => 'Update Slide Set', 'separate_items_with_commas' => 'Separate slide sets with commas', 'search_items' => 'Search Slide Sets', 'add_or_remove_items' => 'Add or remove slide sets', 'choose_from_most_used' => 'Choose from the most used slide sets', 'not_found' => 'Not Found', ); $args = array( 'labels' => $labels, 'hierarchical' => false, 'public' => true, 'show_ui' => true, 'show_admin_column' => true, 'show_in_nav_menus' => false, 'show_tagcloud' => false, ); register_taxonomy( 'slide_set', 'slideshow', $args ); } add_action('init', 'theme_setup_init'); //REGISTER THEME SIDEBARS function theme_sidebar_init() { register_sidebar( array( 'name' => 'Blog Sidebar', 'id' => 'blog-sidebar', 'description' => 'Sidebar that appears on the right on blog entries.', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => 'Page Sidebar', 'id' => 'page-sidebar', 'description' => 'Sidebar that appears on the right side of pages.', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => 'Footer Sidebar Area', 'id' => 'footer-sidebar', 'description' => 'Horizontal sidebar that appears in the site footer. It is best when widgets appear in multiples of three.', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => 'In The Index Sidebar Area', 'id' => 'index-sidebar', 'description' => 'This sidebar appears on the front page of your blog, after the second post. It is most useful if you have excerpts turned on on the front page. And it displays best either with a text widget or advertisement, or when widgets appear in groups of two.', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'theme_sidebar_init' ); function theme_setup_after_setup_theme() { //IMAGE SIZES add_theme_support('post-thumbnails'); set_post_thumbnail_size( 200, 200, true ); add_image_size('featured-image', 1000, 450, true); update_option('medium_size_w', 600); update_option('medium_size_h', 600); //POST FORMATS add_theme_support( 'post-formats', array( 'gallery', 'aside', 'quote', 'image', 'video', 'status' ) ); //RSS IN THE HEAD add_theme_support( 'automatic-feed-links' ); //HEADER IMAGE $header_args = array( 'default-image' => get_template_directory_uri() . '/images/default.jpg', 'width' => 2048, 'height' => 773, 'uploads' => true, ); add_theme_support( 'custom-header', $header_args ); //SEMANTIC MARKUP $markup = array( 'comment-list', 'comment-form', 'search-form', 'gallery', 'caption', ); add_theme_support( 'html5', $markup ); } add_action('after_setup_theme', 'theme_setup_after_setup_theme'); //ADDS IMAGE SIZES TO THE CHOOSER function theme_add_custom_sizes( $imageSizes ) { $my_sizes = array( 'featured-image' => 'Featured'); return array_merge( $imageSizes, $my_sizes ); } //CONSTRUCTS NAV MENUS if ( ! function_exists( 'theme_primary_navigation' ) ) { function theme_primary_navigation() { $menu_options = array ( 'theme_location' => 'primary-menu', 'menu' => '', 'container' => false, 'menu_class' => 'sf-menu', 'fallback_cb' => 'wp_page_menu', 'after' => '', 'before' => '', 'depth' => 3, 'walker' => '', 'echo' => false); return wp_nav_menu( $menu_options ); } } if ( ! function_exists( 'theme_mobile_navigation' ) ) { function theme_mobile_navigation() { $menu_options = array ( 'theme_location' => 'mobile-menu', 'menu' => '', 'container' => false, 'menu_class' => 'mobile-nav', 'fallback_cb' => 'wp_page_menu', 'after' => '', 'before' => '', 'depth' => 3, 'walker' => '', 'echo' => false); return wp_nav_menu( $menu_options ); } } if ( ! function_exists( 'theme_supplementary_navigation' ) ) { function theme_supplementary_navigation() { $menu_options = array ( 'theme_location' => 'supplementary-menu', 'menu' => '', 'container' => false, 'menu_class' => 'sf-menu', 'fallback_cb' => 'wp_page_menu', 'after' => '', 'before' => '', 'depth' => 1, 'walker' => '', 'echo' => false); return wp_nav_menu( $menu_options ); } } // RULES FOR WHEN TO USE FULL CONTENT OR WHEN TO USE THE EXCERPT (THANKS TO THEMATIC FOR THIS GREAT IDEA!) if ( ! function_exists( 'theme_excerptorfull' ) ) { function theme_excerptorfull() { $content = ''; $excerptorfull = get_option('baleen_theme_settings'); if (is_home()) { $content = $excerptorfull['excerpt_main']; } elseif ((is_single()) || (is_page())) { $content = 'Full Post'; } elseif (is_archive()) { $content = $excerptorfull['excerpt_archive']; } elseif (is_search()) { $content = $excerptorfull['excerpt_search']; } return $content; } } //EXCLUDES STICKY POSTS FROM THE MAIN LOOP if (! function_exists('theme_exclude_sticky') ){ function theme_exclude_sticky( $query ) { if ( $query->is_home() && $query->is_main_query() ) { $query->set('post__not_in', get_option('sticky_posts')); } } add_action( 'pre_get_posts', 'theme_exclude_sticky' ); } /******************************************************** * Paging Navigation * *********************************************************/ //PAGING NAVIGATION if ( ! function_exists( 'theme_paging_navigation' )) { function theme_paging_navigation() { if (is_single()) { ?>', '%title') ?> %link  →', '%title') ?> ', 0) ?>Creative Commons LicenseThis work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.'; }*/ if ($output == 'echo') { echo $license_info; } else { return $license_info; } } //RETURNS SOCIAL MEDIA INFO function theme_social_media($output='return', $style=null) { /* $display_rss = get_option('theme_social_media_rss'); $display_social_media = get_option('theme_social_media_urls'); $display_custom_service = get_option('theme_social_media_custom');*/ $options = get_option('baleen_theme_settings'); $social_media = ''; if ($options['social_displayrss'] == '1') { $social_media .= ''; } if ($options['social_facebook']) { $social_media .= ''; } if ($options['social_twitter']) { $social_media .= ''; } if ($options['social_googleplus']) { $social_media .= ''; } if ($options['social_youtube']) { $social_media .= ''; } if ($options['social_pinterest']) { $social_media .= ''; } if ($options['social_linkedin']) { $social_media .= ''; } if ($options['social_customurl']) { $social_media .= ''; } // $social_media .= ''; $social_media .= ''; if ($output == 'echo') { echo $social_media; } else { return $social_media; } } /******************************************************** * Horizontal Sidebar * *********************************************************/ function theme_bottom_sidebar_params($params) { // Thanks to Nautilus7 on Stackoverflow (https://wordpress.stackexchange.com/questions/54162/get-number-of-widgets-in-sidebar) for most of this solution $sidebar_id = $params[0]['id']; if ( $sidebar_id == 'footer-sidebar' ) { $total_widgets = wp_get_sidebars_widgets(); $sidebar_widgets = count($total_widgets[$sidebar_id]); $widget_span = 'c33'; $params[0]['before_widget'] = str_replace('class="', 'class="' . $widget_span . ' ', $params[0]['before_widget']); } if ( $sidebar_id == 'index-sidebar' ) { $total_widgets = wp_get_sidebars_widgets(); $sidebar_widgets = count($total_widgets[$sidebar_id]); if ($sidebar_widgets == 1) { $widget_span = 'c100'; } else { $widget_span = 'c50'; } $params[0]['before_widget'] = str_replace('class="', 'class="' . $widget_span . ' ', $params[0]['before_widget']); } return $params; } add_filter('dynamic_sidebar_params','theme_bottom_sidebar_params'); /******************************************************** * Theme Comments * *********************************************************/ if (! function_exists( 'theme_comment' )) { function theme_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; extract($args, EXTR_SKIP); if ( 'div' == $args['style'] ) { $tag = 'div'; $add_below = 'comment'; } else { $tag = 'li'; $add_below = 'div-comment'; } ?> < id="comment-">
says:
$add_below, 'depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
url . "'); background-repeat: repeat-x; background-position:center;\""; if ($output == 'return') { return $background_image; } else { echo $background_image; } } } //CHANGE THE DEFAULT IMAGE SIZE FOR GALLERIES /* if (! function_exists( 'theme_gallery_size_shortcode' )) { function theme_gallery_size_shortcode($atts) { $atts['size'] = 'medium'; //same name as the name we declared in the add_image_size function $atts['columns'] = 0; return gallery_shortcode($atts); } } remove_shortcode('gallery'); add_shortcode('gallery', 'theme_gallery_size_shortcode'); */ //EXCERPT LENGTH if (! function_exists( 'theme_excerpt_length' )) { function theme_excerpt_length() { return 110; } } add_filter( 'excerpt_length', 'theme_excerpt_length'); if (! function_exists( 'theme_trim_excerpt' )) { function theme_trim_excerpt($excerpt) { $raw_excerpt = $excerpt; $excerpt_length = theme_excerpt_length(); if ( '' == $excerpt ) { $excerpt = get_the_content(); $excerpt = strip_shortcodes( $excerpt ); $excerpt = apply_filters('the_content', $excerpt); $excerpt = str_replace(']]>', ']]>', $excerpt); $excerpt = strip_tags($excerpt); $excerpt_more = apply_filters('excerpt_more', ' ' . '. . .'); $words = explode(' ', $excerpt, $excerpt_length + 1); if ( count($words) > $excerpt_length ) { array_pop($words); $excerpt = implode(' ', $words); $excerpt = $excerpt . $excerpt_more; } else { $excerpt = implode(' ', $words); } } $excerpt .= '

 Continue Reading →

'; return apply_filters('theme_trim_excerpt', $excerpt, $raw_excerpt); } } remove_filter('get_the_excerpt', 'wp_trim_excerpt'); add_filter('get_the_excerpt', 'theme_trim_excerpt');