'#F6F4F2', )); /** * Support panels */ add_theme_support( 'siteorigin-panels', array( 'margin-bottom' => 30, 'responsive' => siteorigin_setting('layout_responsive'), ) ); add_theme_support( 'siteorigin-premium-teaser', array( 'post-type' => array('post') ) ); /** * This theme uses wp_nav_menu() in one location. */ register_nav_menus( array( 'primary' => __( 'Primary Menu', 'focus' ), ) ); /** * Add custom image sizes */ add_image_size('slider', 1280, 768, true); set_post_thumbnail_size(297, 160, true); // Include the lite version of the page builder if( !defined('SITEORIGIN_PANELS_VERSION') && !siteorigin_plugin_activation_is_activating('siteorigin-panels') ){ include get_template_directory().'/extras/panels-lite/panels-lite.php'; } } endif; // focus_setup add_action( 'after_setup_theme', 'focus_setup' ); /** * Register widgetized area and update sidebar with default widgets * * @since focus 1.0 */ function focus_widgets_init() { register_sidebar( array( 'name' => __( 'Post Sidebar', 'focus' ), 'id' => 'sidebar-post', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Page Sidebar', 'focus' ), 'id' => 'sidebar-page', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer Widgets', 'focus' ), 'id' => 'sidebar-footer', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'focus_widgets_init' ); /** * Enqueue scripts and styles */ function focus_scripts() { wp_enqueue_style( 'style', get_stylesheet_uri() , array() , SITEORIGIN_THEME_VERSION); wp_enqueue_script('flexslider', get_template_directory_uri().'/js/jquery.flexslider.min.js', array('jquery'), '2.1'); wp_enqueue_script('focus', get_template_directory_uri().'/js/focus.min.js', array('jquery'), SITEORIGIN_THEME_VERSION); wp_localize_script('focus', 'focus', array( 'mobile' => wp_is_mobile(), )); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } if ( is_singular() && wp_attachment_is_image() ) { wp_enqueue_script( 'keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.min.js', array( 'jquery' ), '20120202' ); } } add_action( 'wp_enqueue_scripts', 'focus_scripts' ); /** * @return WP_Query */ function focus_get_slider_posts(){ return new WP_Query(apply_filters('focus_slider_posts_query', array( 'post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => siteorigin_setting('slider_post_count'), 'orderby' => 'post_date', 'order' => 'DESC', ))); } /** * Change the footer text. * @param $text * @return string */ function focus_admin_footer_text($text){ return '' . __( 'Thank you for creating with WordPress and Focus.', 'focus' ) . ''; } add_filter('admin_footer_text', 'focus_admin_footer_text'); /** * Display the footer call to action */ function focus_display_footer_cta(){ $args = array( 'text' => siteorigin_setting('cta_text'), 'button_text' => siteorigin_setting('cta_button_text'), 'button_url' => siteorigin_setting('cta_button_url'), ); $args['button_url'] = do_shortcode($args['button_url']); $args = apply_filters('focus_cta_args', $args); if(empty($args['text']) && empty($args['button_text']) && empty($args['button_url'])) return; ?> SiteOrigin', 'focus'), 'http://siteorigin.com'); } add_action('focus_credits', 'focus_theme_credit'); /** * Display the default post thumbnail * * @return string */ function focus_default_post_thumbnail(){ return ''; } /** * Add the HTML shiv to the header. */ function focus_html5_shiv(){ ?>