'f0eeeb', 'default-image' => get_template_directory_uri().'/images/bg.png' ); $background = apply_filters('origami_custom_background', $background); add_theme_support( 'custom-background', $background); // Use custom headers for site logo add_theme_support( 'custom-header' , array( 'flex-height' => true, 'flex-width' => true, 'header-text' => false, )); add_theme_support( "title-tag" ); add_editor_style(); // Set up the image sizes set_post_thumbnail_size(904,400,true); add_image_size('post-thumbnail-mobile', 480, 420, true); add_image_size('post-thumbnail-full', 904, 904, false); add_image_size('origami-slider', 904, 500, true); /** * Support panels */ add_theme_support( 'siteorigin-panels', array( 'margin-bottom' => 30, 'responsive' => true, 'home-page' => true, 'home-page-default' => false, ) ); add_theme_support( 'custom-logo', array( 'height' => 240, 'width' => 240, 'flex-height' => true, ) ); if( siteorigin_setting('responsive_nav') ) { include get_template_directory().'/inc/mobilenav/mobilenav.php'; } } endif; add_action('after_setup_theme', 'origami_setup'); function origami_siteorigin_premium_support(){ // This theme supports the no attribution addon add_theme_support( 'siteorigin-premium-no-attribution', array( 'filter' => 'siteorigin_attribution_footer', 'enabled' => siteorigin_setting( 'display_attribution' ), 'siteorigin_setting' => 'display_attribution' ) ); // This theme supports the ajax comments addon add_theme_support( 'siteorigin-premium-ajax-comments', array( 'enabled' => siteorigin_setting( 'comments_ajax' ), 'siteorigin_setting' => 'comments_ajax' ) ); } add_action( 'after_setup_theme', 'origami_siteorigin_premium_support' ); if(!function_exists('origami_widgets_init')) : /** * Registers Origami's Sidebars * * @action register_sidebar */ function origami_widgets_init(){ register_sidebar( array( 'id' => 'site-footer', 'name' => __( 'Footer', 'origami' ), 'before_widget' => '
', 'after_widget' => '
', ) ); register_widget( 'SiteOrigin_Widgets_CTA' ); register_widget( 'SiteOrigin_Widgets_Button' ); register_widget( 'SiteOrigin_Widgets_Headline' ); register_widget( 'SiteOrigin_Widgets_IconText' ); } endif; add_action('widgets_init', 'origami_widgets_init'); if(!function_exists('origami_title')) : /** * Give Origami a nice title. * * @param string $title The starting title * @param $sep * @param $seplocation * @return string * * @filter wp_title */ function origami_title($title, $sep, $seplocation){ global $page, $paged; if ( is_feed() ) return $title; // Add the blog name. $title = $title.get_bloginfo( 'name' ); // Add the blog description for the home/front page. $site_description = get_bloginfo( 'description', 'display' ); if ( $site_description && ( is_home() || is_front_page() ) ) $title = "$title $sep $site_description"; // Add a page number if necessary: if ( $paged >= 2 || $page >= 2 ) $title .= ' | ' . sprintf( __( 'Page %s', 'origami' ), max( $paged, $page ) ); return $title; } endif; add_filter('wp_title', 'origami_title', 10, 3); if ( ! function_exists( 'origami_enqueue_scripts' ) ) : /** * Enqueue Origami's scripts. * * @action * @return void */ function origami_enqueue_scripts() { wp_enqueue_style( 'origami', get_stylesheet_uri(), array(), SITEORIGIN_THEME_VERSION ); if ( ! class_exists( 'Jetpack' ) && siteorigin_setting( 'responsive_fitvids' ) ) { wp_enqueue_script( 'fitvids', get_template_directory_uri() . '/js/jquery.fitvids' . SITEORIGIN_THEME_JS_PREFIX . '.js', array( 'jquery' ), '1.0' ); } wp_enqueue_script( 'origami', get_template_directory_uri() . '/js/origami' . SITEORIGIN_THEME_JS_PREFIX . '.js', array( 'jquery' ), SITEORIGIN_THEME_VERSION ); wp_enqueue_script( 'flexslider', get_template_directory_uri() . '/js/jquery.flexslider' . SITEORIGIN_THEME_JS_PREFIX . '.js', array( 'jquery' ), '2.1' ); wp_enqueue_style( 'flexslider', get_template_directory_uri() . '/css/flexslider.css', array(), '2.0' ); if ( is_singular() ) wp_enqueue_script( "comment-reply" ); } endif; add_action('wp_enqueue_scripts', 'origami_enqueue_scripts'); if(!function_exists('origami_add_meta_boxes')) : /** * Add post metaboxes * * @action add_meta_boxes */ function origami_add_meta_boxes(){ // Add the column metaboxes to posts and pages add_meta_box('post-columns', __('Columns', 'origami'), 'origami_render_metabox_columns', 'post', 'side'); add_meta_box('post-columns', __('Columns', 'origami'), 'origami_render_metabox_columns', 'page', 'side'); } endif; add_action('add_meta_boxes', 'origami_add_meta_boxes'); if(!function_exists('origami_render_metabox_columns')) : /** * Render the columns metabox. */ function origami_render_metabox_columns(){ get_template_part('admin/metabox', 'columns'); } endif; if(!function_exists('origami_save_post')) : /** * Save the post * * @action save_post */ function origami_save_post($post_id){ if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return; if(!current_user_can('edit_post', $post_id)) return; if(!isset($_REQUEST['content_columns'])) return; update_post_meta($post_id, 'content_columns', intval($_REQUEST['content_columns'])); } endif; add_action('save_post', 'origami_save_post'); if(!function_exists('origami_enqueue_google_webfonts')) : /** * This just displays the Google web fonts */ function origami_enqueue_google_webfonts(){ if( ! get_header_image() ){ // Enqueue the logo font as well (Terminal Dosis 200) wp_enqueue_style('google-webfonts', '//fonts.googleapis.com/css?family=Terminal+Dosis:200,400'); } else{ // Enqueue only the text fonts that we need wp_enqueue_style('google-webfonts', '//fonts.googleapis.com/css?family=Terminal+Dosis:400'); } } endif; add_action('wp_enqueue_scripts', 'origami_enqueue_google_webfonts'); if(!function_exists('origami_comment')) : /** * Display a comment * * @param $comment The comment * @param $args The arguments * @param $depth The depth */ function origami_comment($comment, $args, $depth){ $GLOBALS['comment'] = $comment; ?>
  • id="comment-">
    comment_ID); ?>
    $depth, 'max_depth' => $args['max_depth'])) ?>
    ID)){ case 'chat': $content = preg_replace('/(.*)\:/', '$1: ', $content); } return $content; } endif; add_filter('the_content', 'origami_content_filter', 8); function origami_print_styles(){ // Create the footer widget CSS $sidebars_widgets = wp_get_sidebars_widgets(); $count = isset($sidebars_widgets['site-footer']) ? count($sidebars_widgets['site-footer']) : 1; $count = max($count,1); ?> $d){ if(!empty($d['info']['class'])){ switch($d['info']['class']){ case 'SiteOrigin_Widgets_Gallery': $data['widgets'][$i]['info']['class'] = 'SiteOrigin_Panels_Widgets_Gallery'; break; case 'SiteOrigin_Widgets_Image': $data['widgets'][$i]['info']['class'] = 'SiteOrigin_Panels_Widgets_Image'; break; case 'SiteOrigin_Widgets_PostContent': $data['widgets'][$i]['info']['class'] = 'SiteOrigin_Panels_Widgets_PostContent'; break; } } } return $data; } add_filter('siteorigin_panels_data', 'origami_siteorigin_panels_data'); /** * This overwrites the show on front setting when we're displaying the blog archive page. * * @param $r * @return bool */ function origami_filter_show_on_front($r){ /** * @var WP_Query */ global $origami_is_blog_archive; if( !empty($origami_is_blog_archive) ) { return false; } else return $r; } add_filter('option_show_on_front', 'origami_filter_show_on_front'); /** * Sets when we're displaying the blog archive page. * * @param $new */ function origami_set_is_blog_archive($new) { global $origami_is_blog_archive; $origami_is_blog_archive = $new; } if( ! function_exists( 'origami_header_image' ) ) : function origami_header_image(){ if( function_exists( 'has_custom_logo' ) && has_custom_logo() ) { $logo = get_custom_logo(); if( !empty( $logo ) ) { echo $logo; return true; } } if( function_exists( 'has_header_image' ) && has_header_image() ) { $header = get_custom_header(); echo 'height)) { echo ' height="' . $header->height . '"'; } if(!empty($header->width)) { echo ' width="' . $header->width . '"'; } echo ' alt="' . esc_attr( get_bloginfo('name') ) . '" />'; return true; } return false; } endif; function origami_wp_header(){ if( siteorigin_setting('responsive_enabled') ) { ?>