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 supports post thumbnails. 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', 'foreverwood_setup' ); /** * Enqueues scripts and styles for front-end. * */ function foreverwood_scripts_styles() { global $wp_styles, $wp_scripts, $foreverwood_options_db; // Adds JavaScript if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); if ( $foreverwood_options_db['foreverwood_post_entry_format'] == 'Grid - Masonry' ) { if ( is_home() || is_archive() || is_search() ) { wp_enqueue_script( 'jquery-masonry', array( 'jquery' ) ); if ( !is_rtl() ) { wp_enqueue_script( 'foreverwood-masonry-settings', get_template_directory_uri() . '/js/masonry-settings.js', array(), '1.0', true ); } else { wp_enqueue_script( 'foreverwood-masonry-settings-rtl', get_template_directory_uri() . '/js/masonry-settings-rtl.js', array(), '1.0', true ); }}} wp_enqueue_script( 'foreverwood-placeholders', get_template_directory_uri() . '/js/placeholders.js', array(), '2.1.0', true ); wp_enqueue_script( 'foreverwood-scroll-to-top', get_template_directory_uri() . '/js/scroll-to-top.js', array( 'jquery' ), '1.0', true ); if ( $foreverwood_options_db['foreverwood_header_layout'] != 'Wide' && !is_page_template('template-landing-page.php') ) { wp_enqueue_script( 'foreverwood-menubox', get_template_directory_uri() . '/js/menubox.js', array(), '1.0', true ); } wp_enqueue_script( 'foreverwood-selectnav', get_template_directory_uri() . '/js/selectnav.js', array(), '0.1', true ); wp_enqueue_script( 'foreverwood-responsive', get_template_directory_uri() . '/js/responsive.js', array(), '1.0', true ); wp_enqueue_script( 'foreverwood-html5-ie', get_template_directory_uri() . '/js/html5.js', array(), '3.6', false ); $wp_scripts->add_data( 'foreverwood-html5-ie', 'conditional', 'lt IE 9' ); wp_enqueue_style( 'foreverwood-elegantfont', get_template_directory_uri() . '/css/elegantfont.css' ); wp_enqueue_style( 'foreverwood-style', get_stylesheet_uri() ); wp_enqueue_style( 'foreverwood-google-font-default', '//fonts.googleapis.com/css?family=PT+Sans&subset=latin,latin-ext' ); if ( class_exists( 'woocommerce' ) ) { wp_enqueue_style( 'foreverwood-woocommerce-custom', get_template_directory_uri() . '/css/woocommerce-custom.css' ); } } add_action( 'wp_enqueue_scripts', 'foreverwood_scripts_styles' ); /** * Creates a nicely formatted and more specific title element text. * */ function foreverwood_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', 'foreverwood_wp_title', 10, 2 ); /** * Register our menu. * */ function foreverwood_register_my_menu() { register_nav_menu( 'main-navigation', __( 'Main Header Menu', 'foreverwood' ) ); } add_action( 'after_setup_theme', 'foreverwood_register_my_menu' ); /** * Register our sidebars and widgetized areas. * */ function foreverwood_widgets_init() { register_sidebar( array( 'name' => __( 'Right Sidebar', 'foreverwood' ), 'id' => 'sidebar-1', 'description' => __( 'Right sidebar which appears on all posts and pages.', 'foreverwood' ), 'before_widget' => '
', 'before_title' => ' ', ) ); register_sidebar( array( 'name' => __( 'Footer left widget area', 'foreverwood' ), 'id' => 'sidebar-2', 'description' => __( 'Left column with widgets in footer.', 'foreverwood' ), 'before_widget' => ' ', 'before_title' => ' ', ) ); register_sidebar( array( 'name' => __( 'Footer middle widget area', 'foreverwood' ), 'id' => 'sidebar-3', 'description' => __( 'Middle column with widgets in footer.', 'foreverwood' ), 'before_widget' => ' ', 'before_title' => ' ', ) ); register_sidebar( array( 'name' => __( 'Footer right widget area', 'foreverwood' ), 'id' => 'sidebar-4', 'description' => __( 'Right column with widgets in footer.', 'foreverwood' ), 'before_widget' => ' ', 'before_title' => ' ', ) ); register_sidebar( array( 'name' => __( 'Footer notices', 'foreverwood' ), '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.', 'foreverwood' ), 'before_widget' => ' ', 'before_title' => '', 'after_title' => '', ) ); } add_action( 'widgets_init', 'foreverwood_widgets_init' ); /** * Post excerpt settings. * */ function foreverwood_custom_excerpt_length( $length ) { return 40; } add_filter( 'excerpt_length', 'foreverwood_custom_excerpt_length', 20 ); function foreverwood_new_excerpt_more( $more ) { global $post; return '...', '' ); ?>