Version ) ); define( 'BAVOTASAN_THEME_NAME', $bavotasan_theme_data->Name ); define( 'BAVOTASAN_THEME_FILE', get_option( 'template' ) ); define( 'FONT_AWESOME_VERSION', '4.0.3' ); /** * Includes * * @since 1.0.0 */ require( BAVOTASAN_THEME_TEMPLATE . '/library/customizer.php' ); // Functions for theme options page require( BAVOTASAN_THEME_TEMPLATE . '/library/preview-pro.php' ); // Functions for preview pro page require( BAVOTASAN_THEME_TEMPLATE . '/library/custom-metaboxes.php' ); // Functions for home page alignment /** * Prepare the content width * * @since 1.0.0 */ $bavotasan_theme_options = bavotasan_theme_options(); $array_content = array( 'col-md-2' => .1666, 'col-md-3' => .25, 'col-md-4' => .3333, 'col-md-5' => .4166, 'col-md-6' => .5, 'col-md-7' => .5833, 'col-md-8' => .6666, 'col-md-9' => .75, 'col-md-10' => .8333, 'col-md-12' => 1 ); $bavotasan_main_content = $array_content[$bavotasan_theme_options['primary']] * $bavotasan_theme_options['width'] - 30; if ( ! isset( $content_width ) ) $content_width = round( $bavotasan_main_content ); add_action( 'after_setup_theme', 'bavotasan_setup' ); if ( ! function_exists( 'bavotasan_setup' ) ) : /** * Initial setup * * This function is attached to the 'after_setup_theme' action hook. * * @uses load_theme_textdomain() * @uses get_locale() * @uses BAVOTASAN_THEME_TEMPLATE * @uses add_theme_support() * @uses add_editor_style() * @uses add_custom_background() * @uses add_custom_image_header() * @uses register_default_headers() * * @since 1.0.0 */ function bavotasan_setup() { load_theme_textdomain( 'arcade', BAVOTASAN_THEME_TEMPLATE . '/library/languages' ); // Add default posts and comments RSS feed links to
. add_theme_support( 'automatic-feed-links' ); // This theme styles the visual editor with editor-style.css to match the theme style. add_editor_style(); // This theme uses wp_nav_menu() in two location. register_nav_menu( 'primary', __( 'Primary Menu', 'arcade' ) ); // Add support for a variety of post formats add_theme_support( 'post-formats', array( 'gallery', 'image', 'video', 'audio', 'quote', 'link', 'status', 'aside' ) ); // This theme uses Featured Images (also known as post thumbnails) for archive pages add_theme_support( 'post-thumbnails' ); add_image_size( 'half', 570, 220, true ); add_image_size( 'square100', 100, 100, true ); // Add a filter to bavotasan_header_image_width and bavotasan_header_image_height to change the width and height of your custom header. add_theme_support( 'custom-header', array( 'header-text' => false, 'flex-height' => true, 'flex-width' => true, 'random-default' => true, 'width' => apply_filters( 'bavotasan_header_image_width', 1500 ), 'height' => apply_filters( 'bavotasan_header_image_height', 600 ), ) ); // Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI. register_default_headers( array( 'header01' => array( 'url' => '%s/library/images/header01.jpg', 'thumbnail_url' => '%s/library/images/header01-thumbnail.jpg', 'description' => __( 'Default Header 1', 'arcade' ) ), ) ); // Add support for custom backgrounds add_theme_support( 'custom-background' ); // Add HTML5 elements add_theme_support( 'html5', array( 'comment-list', 'comment-form', ) ); // Infinite scroll add_theme_support( 'infinite-scroll', array( 'type' => 'scroll', 'container' => 'primary', 'wrapper' => false, 'footer' => false, ) ); } endif; // bavotasan_setup add_action( 'pre_get_posts', 'bavotasan_home_page_query' ); /** * Set up home page query * * This function is attached to the 'pre_get_posts' action hook. * * @since 1.0.0 */ function bavotasan_home_page_query( $query ) { if ( $query->is_home() && $query->is_main_query() ) { if ( get_queried_object_id() == get_option('page_for_posts') ) return; $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; $per_page = get_option( 'posts_per_page' ); $offset = ( 1 < $paged ) ? ( 10 * ( $paged - 1 ) + 4 ) - $per_page : 0; $show = ( 0 == $offset ) ? 4 : $per_page; $query->set( 'ignore_sticky_posts', true ); $query->set( 'posts_per_page', $show ); $query->set( 'offset', $offset ); } } add_action( 'wp_head', 'bavotasan_styles' ); /** * Add a style block to the theme for the current link color. * * This function is attached to the 'wp_head' action hook. * * @since 1.0.0 */ function bavotasan_styles() { $bavotasan_theme_options = bavotasan_theme_options(); ?> $bavotasan_theme_options['arc'], ) ); wp_enqueue_style( 'theme_stylesheet', get_stylesheet_uri() ); wp_enqueue_style( 'google_fonts', '//fonts.googleapis.com/css?family=Megrim|Raleway|Open+Sans:400,400italic,700,700italic', false, null, 'all' ); wp_enqueue_style( 'font_awesome', esc_url( '//netdna.bootstrapcdn.com/font-awesome/' . FONT_AWESOME_VERSION . '/css/font-awesome.css' ), false, null, 'all' ); } endif; // bavotasan_add_js add_action( 'widgets_init', 'bavotasan_widgets_init' ); if ( ! function_exists( 'bavotasan_widgets_init' ) ) : /** * Creating the two sidebars * * This function is attached to the 'widgets_init' action hook. * * @uses register_sidebar() * * @since 1.0.0 */ function bavotasan_widgets_init() { $bavotasan_theme_options = bavotasan_theme_options(); require( BAVOTASAN_THEME_TEMPLATE . '/library/widgets/widget-image-icon.php' ); // Custom Image/Icon Text widget register_sidebar( array( 'name' => __( 'First Sidebar', 'arcade' ), 'id' => 'sidebar', 'description' => __( 'This is the first sidebar. It won\'t appear on the home page unless you set a static front page.', 'arcade' ), 'before_widget' => '', 'before_title' => '