for posts and comments. add_theme_support('automatic-feed-links'); add_theme_support( 'title-tag' ); add_theme_support('post-thumbnails'); set_post_thumbnail_size(672, 372, true); add_image_size('a1-full-width', 1038, 576, true); add_image_size('a1-portfolio-image', 320, 260, true); // This theme uses wp_nav_menu() in two locations. register_nav_menus(array( 'primary' => __('Header Menu', 'a1'), 'secondary' => __('Footer Menu', 'a1'), )); //custom background add_theme_support( 'custom-background', apply_filters( 'a1_custom_background_args', array( 'default-color' => 'f5f5f5', ) ) ); add_theme_support( 'custom-header', apply_filters( 'a1_custom_header_args', array( 'uploads' => true, 'flex-height' => true, 'default-text-color' => '#000', 'header-text' => true, 'height' => '120', 'width' => '1260' ) ) ); add_theme_support( 'custom-logo', array( 'height' => 250, 'width' => 250, 'flex-width' => true, 'flex-height' => true, 'priority' => 11, 'header-text' => array('img-responsive-logo', 'site-description-logo'), ) ); /* * Switch default core markup for search form, comment form, and comments * to output valid HTML5. */ add_theme_support('html5', array( 'search-form', 'comment-form', 'comment-list', )); // Add support for featured content. add_theme_support('featured-content', array( 'featured_content_filter' => 'a1_get_featured_posts', 'max_posts' => 6, )); // This theme uses its own gallery styles. add_filter('use_default_gallery_style', '__return_false'); } endif; // a1_setup add_action('after_setup_theme', 'a1_setup'); /*Title*/ function a1_wp_title( $title, $sep ) { global $paged, $page; if ( is_feed() ) { return $title; } // end if // Add the site name. $title .= get_bloginfo( 'name' ); // Add the site 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"; } // end if // Add a page number if necessary. if ( $paged >= 2 || $page >= 2 ) { $title = sprintf(/* translators: %s is count.*/ __( 'Page %s', 'a1' ), max( $paged, $page ) ) . " $sep $title"; } // end if return $title; } // end blogim_wp_title add_filter( 'wp_title', 'a1_wp_title', 10, 2 ); /** Register Lato Google font for a1.*/ function a1_font_url() { $a1_font_url = ''; if ('off' !== _x('on', 'Open Sans font: on or off', 'a1')) { $a1_font_url = add_query_arg('family', urlencode('Open Sans:300,400,700,900,300italic,400italic,700italic'), "//fonts.googleapis.com/css"); } return $a1_font_url; } // thumbnail list function a1_thumbnail_image($content) { if (has_post_thumbnail()) return the_post_thumbnail('thumbnail'); } /* * Set Theme Option variable as a global */ $a1_options = get_option('a1_theme_options'); global $a1_options; /** Register widget areas.*/ function a1_widgets_init() { register_sidebar(array( 'name' => __('Primary Sidebar', 'a1'), 'id' => 'sidebar-1', 'description' => __('Main sidebar that appears on the right.', 'a1'), 'before_widget' => '', 'before_title' => '', )); register_sidebar(array( 'name' => __('Footer Area One', 'a1'), 'id' => 'footer-1', 'description' => __('Footer Area One that appears on the footer.', 'a1'), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => __('Footer Area Two', 'a1'), 'id' => 'footer-2', 'description' => __('Footer Area Two that appears on the footer.', 'a1'), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => __('Footer Area Three', 'a1'), 'id' => 'footer-3', 'description' => __('Footer Area Three that appears on the footer.', 'a1'), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => __('Footer Area Four', 'a1'), 'id' => 'footer-4', 'description' => __('Footer Area Four that appears on the footer.', 'a1'), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', )); } add_action('widgets_init', 'a1_widgets_init'); /**Remove ? from JS and CSS**/ function remove_cssjs_ver( $src ) { if( strpos( $src, '?ver=' ) ) $src = remove_query_arg( 'ver', $src ); return $src; } add_filter( 'style_loader_src', 'remove_cssjs_ver', 10, 2 ); add_filter( 'script_loader_src', 'remove_cssjs_ver', 10, 2 ); /* Add default menu style if menu is not set from the backend.*/ function a1_add_menuid($page_markup) { preg_match('/^
/i', $page_markup, $a1_matches); $a1_divclass = ''; if (!empty($a1_matches)) { $a1_divclass = $a1_matches[1]; } $a1_toreplace = array('
', '
'); $a1_replace = array(''); $a1_new_markup = str_replace($a1_toreplace, $a1_replace, $page_markup); $a1_new_markup = preg_replace('/