for posts and comments. add_theme_support( 'automatic-feed-links' ); // This theme supports custom background color and image. $defaults = array( 'default-color' => '', 'default-image' => '', 'wp-head-callback' => '_custom_background_cb', 'admin-head-callback' => '', 'admin-preview-callback' => '' ); add_theme_support( 'custom-background', $defaults ); // This theme uses a custom image size for featured images, displayed on "standard" posts. add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 1170, 9999 ); // This theme uses a custom header background image. $args = array( 'width' => 1800, 'flex-width' => true, 'flex-height' => true, 'header-text' => false, 'random-default' => true,); add_theme_support( 'custom-header', $args ); add_theme_support( 'woocommerce' ); global $content_width; if ( ! isset( $content_width ) ) { $content_width = 840; } } add_action( 'after_setup_theme', 'seasun_setup' ); /** * Enqueues scripts and styles for front-end. * */ function seasun_scripts_styles() { global $wp_styles, $seasun_options_db; // Adds JavaScript if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); if ( $seasun_options_db['seasun_post_entry_format'] != 'One Column' ) { if ( is_home() || is_archive() || is_search() ) { wp_enqueue_script( 'jquery-masonry' ); if ( !is_rtl() ) { wp_enqueue_script( 'seasun-masonry-settings', get_template_directory_uri() . '/js/masonry-settings.js', array(), '1.0', true ); } else { wp_enqueue_script( 'seasun-masonry-settings-rtl', get_template_directory_uri() . '/js/masonry-settings-rtl.js', array(), '1.0', true ); }}} wp_enqueue_script( 'seasun-placeholders', get_template_directory_uri() . '/js/placeholders.js', array(), '2.1.0', true ); wp_enqueue_script( 'seasun-scroll-to-top', get_template_directory_uri() . '/js/scroll-to-top.js', array( 'jquery' ), '1.0', true ); if ( has_nav_menu( 'main-navigation' ) && $seasun_options_db['seasun_header_layout'] != 'Wide' && !is_page_template('template-landing-page.php') ) { wp_enqueue_script( 'seasun-menubox', get_template_directory_uri() . '/js/menubox.js', array(), '1.0', true ); } wp_enqueue_script( 'seasun-selectnav', get_template_directory_uri() . '/js/selectnav.js', array(), '0.1', true ); wp_enqueue_script( 'seasun-responsive', get_template_directory_uri() . '/js/responsive.js', array(), '1.0', true ); // Loads the main stylesheet. wp_enqueue_style( 'seasun-style', get_stylesheet_uri() ); wp_enqueue_style( 'seasun-google-font-default', '//fonts.googleapis.com/css?family=Roboto+Condensed&subset=latin,latin-ext' ); if ( class_exists( 'woocommerce' ) ) { wp_enqueue_style( 'seasun-woocommerce-custom', get_template_directory_uri() . '/css/woocommerce-custom.css' ); } } add_action( 'wp_enqueue_scripts', 'seasun_scripts_styles' ); /** * Creates a nicely formatted and more specific title element text. * */ function seasun_wp_title( $title, $sep ) { if ( is_feed() ) return $title; $title .= get_bloginfo( 'name' ); $site_description = get_bloginfo( 'description', 'display' ); if ( $site_description && ( is_home() || is_front_page() ) ) $title = "$title $sep $site_description"; return $title; } add_filter( 'wp_title', 'seasun_wp_title', 10, 2 ); /** * Register our menus. * */ function seasun_register_my_menus() { register_nav_menus( array( 'main-navigation' => __( 'Main Header Menu', 'seasun' ), 'top-navigation' => __( 'Top Header Menu', 'seasun' ) ) ); } add_action( 'after_setup_theme', 'seasun_register_my_menus' ); /** * Register our sidebars and widgetized areas. * */ function seasun_widgets_init() { register_sidebar( array( 'name' => __( 'Right Sidebar', 'seasun' ), 'id' => 'sidebar-1', 'description' => __( 'Right sidebar which appears on all posts and pages.', 'seasun' ), 'before_widget' => '
', 'before_title' => ' ', ) ); register_sidebar( array( 'name' => __( 'Footer left widget area', 'seasun' ), 'id' => 'sidebar-2', 'description' => __( 'Left column with widgets in footer.', 'seasun' ), 'before_widget' => ' ', 'before_title' => ' ', ) ); register_sidebar( array( 'name' => __( 'Footer middle widget area', 'seasun' ), 'id' => 'sidebar-3', 'description' => __( 'Middle column with widgets in footer.', 'seasun' ), 'before_widget' => ' ', 'before_title' => ' ', ) ); register_sidebar( array( 'name' => __( 'Footer right widget area', 'seasun' ), 'id' => 'sidebar-4', 'description' => __( 'Right column with widgets in footer.', 'seasun' ), 'before_widget' => ' ', 'before_title' => ' ', ) ); register_sidebar( array( 'name' => __( 'Footer notices', 'seasun' ), 'id' => 'sidebar-5', 'description' => __( 'The line for copyright and other notices below the footer widget areas. Insert here one Text widget. The "Title" field at this widget should stay empty.', 'seasun' ), 'before_widget' => ' ', 'before_title' => '', 'after_title' => '', ) ); } add_action( 'widgets_init', 'seasun_widgets_init' ); /** * Post excerpt settings. * */ function seasun_custom_excerpt_length( $length ) { return 40; } add_filter( 'excerpt_length', 'seasun_custom_excerpt_length', 999 ); function seasun_new_excerpt_more( $more ) { global $post; return '...', '' ); ?>