. * @see https://codex.wordpress.org/Title_Tag */ add_theme_support( 'title-tag' ); /** * Shell is now available for translations. * Add your files into /languages/ directory. */ load_theme_textdomain( 'shell', get_template_directory() . '/languages' ); $locale = get_locale(); $locale_file = get_template_directory() . "/languages/$locale.php"; if ( is_readable( $locale_file ) ) { require_once( $locale_file ); } /** * Add callback for custom TinyMCE editor stylesheets. (editor-style.css) * @see http://codex.wordpress.org/Function_Reference/add_editor_style */ add_editor_style(); /** * This feature enables post and comment RSS feed links to head. * @see http://codex.wordpress.org/Function_Reference/add_theme_support#Feed_Links */ add_theme_support( 'automatic-feed-links' ); /** * This feature enables post-thumbnail support for a theme. * @see http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails */ add_theme_support( 'post-thumbnails' ); /** * This feature enables custom-menu support for a theme. * @see http://codex.wordpress.org/Template_Tags/register_nav_menu */ register_nav_menu( 'primary', __( 'Primary Menu', 'shell' ) ); // WordPress 3.4+ if ( function_exists( 'get_custom_header' ) ) { add_theme_support('custom-background'); } // WordPress 3.4+ if ( function_exists( 'get_custom_header' ) ) { add_theme_support( 'custom-header', array ( // Header image default 'default-image' => get_template_directory_uri() . '/images/default-logo.png', // Header text display default 'header-text' => false, // Header image flex width 'flex-width' => true, // Header image width (in pixels) 'width' => 200, // Header image flex height 'flex-height' => true, // Header image height (in pixels) 'height' => 100, // Admin header style callback 'admin-head-callback' => 'shell_admin_header_style' )); // gets included in the admin header function shell_admin_header_style() { ?>
  • id="li-comment-">
  • ' . __( '
    See more ›
    ', 'shell' ) . ''; } /** * Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis and shell_see_more_link(). */ function shell_auto_excerpt_more( $more ) { return '' . shell_see_more(); } add_filter( 'excerpt_more', 'shell_auto_excerpt_more' ); /** * Adds a pretty "See more" link to custom post excerpts. */ function shell_custom_excerpt_more( $output ) { if ( has_excerpt() && ! is_attachment() ) { $output .= shell_see_more(); } return $output; } add_filter( 'get_the_excerpt', 'shell_custom_excerpt_more' ); /** * This function removes inline styles set by WordPress gallery. */ function shell_remove_gallery_css( $css ) { return preg_replace( "##s", '', $css ); } add_filter( 'gallery_style', 'shell_remove_gallery_css' ); /** * This function removes default styles set by WordPress recent comments widget. */ function shell_remove_recent_comments_style() { global $wp_widget_factory; remove_action( 'wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ) ); } add_action( 'widgets_init', 'shell_remove_recent_comments_style' ); /** * Breadcrumb Lists * Allows visitors to quickly navigate back to a previous section or the root page. * * Courtesy of Dimox */ function shell_breadcrumb_lists () { $chevron = ''; $home = 'Home'; // text for the 'Home' link $before = ''; // tag before the current crumb $after = ''; // tag after the current crumb if ( ! is_home() && ! is_front_page() || is_paged() ) { echo ''; } } /** * A safe way of adding javascripts to a WordPress generated page. */ if (!is_admin()) add_action('wp_print_scripts', 'shell_js'); if (!function_exists('shell_js')) { function shell_js() { // JavaScript at the bottom for fast page loading. // except for Modernizr which enables HTML5 elements & feature detects. wp_enqueue_script('modernizr', get_template_directory_uri() . '/js/modernizr.js', array('jquery'), '2.5.3', false); wp_enqueue_script('scripts', get_template_directory_uri() . '/js/scripts.js', array('jquery'), '1.0.5', true); } } /** * Where the post has no post title, but must still display a link to the single-page post view. */ add_filter('the_title', 'shell_title'); function shell_title($title) { if ($title == '') { return 'Untitled'; } else { return $title; } } /** * WordPress Widgets start right here. */ function shell_widgets_init() { register_sidebar(array( 'name' => __('Primary Sidebar Widget', 'shell'), 'description' => __('Area One Primary Widget', 'shell'), 'id' => 'primary-sidebar-widget', 'before_title' => '
    ', 'after_title' => '
    ', 'before_widget' => '', 'after_widget' => '' )); register_sidebar(array( 'name' => __('Primary Home Sidebar Widget', 'shell'), 'description' => __('Area Two Primary Home Widget', 'shell'), 'id' => 'primary-home-sidebar-widget', 'before_title' => '

    ', 'after_title' => '

    ', 'before_widget' => '', 'after_widget' => '' )); register_sidebar(array( 'name' => __('Secondary Home Sidebar Widget', 'shell'), 'description' => __('Area Three Secondary Home Widget', 'shell'), 'id' => 'secondary-home-sidebar-widget', 'before_title' => '

    ', 'after_title' => '

    ', 'before_widget' => '', 'after_widget' => '' )); register_sidebar(array( 'name' => __('Tertiary Home Sidebar Widget', 'shell'), 'description' => __('Area Four Tertiary Home Widget', 'shell'), 'id' => 'tertiary-home-sidebar-widget', 'before_title' => '

    ', 'after_title' => '

    ', 'before_widget' => '', 'after_widget' => '' )); register_sidebar(array( 'name' => __('Gallery Widget', 'shell'), 'description' => __('Area Five Gallery Widget', 'shell'), 'id' => 'gallery-sidebar-widget', 'before_title' => '
    ', 'after_title' => '
    ', 'before_widget' => '', 'after_widget' => '' )); } add_action('widgets_init', 'shell_widgets_init'); add_action( 'wp_enqueue_scripts', 'shell_enqueue_style_css' ); function shell_enqueue_style_css() { wp_enqueue_style( 'style', get_stylesheet_uri() ); } add_action( 'admin_enqueue_scripts', 'shell_enqueue_admin_style_css' ); function shell_enqueue_admin_style_css() { wp_enqueue_style( 'admin-style', get_template_directory_uri() . '/styles/admin-style.css' ); } add_action( 'admin_enqueue_scripts', 'shell_enqueue_admin_theme_options_js' ); function shell_enqueue_admin_theme_options_js() { wp_enqueue_script( 'theme-options', get_template_directory_uri() . '/js/theme-options.js' ); // Add WordPress Media button support wp_enqueue_media(); wp_enqueue_script( 'featured-img-uploader', get_template_directory_uri() . '/js/featured-img-uploader.js', array( 'jquery' ) ); } ?>