ID, 'bikaro_page_layout', true ); } if( empty( $layout_meta ) || is_archive() || is_search() ) { $layout_meta = 'default_layout'; } $bikaro_default_layout = get_theme_mod( 'bikaro_default_layout', 'both_sidebar' ); if( $layout_meta == 'default_layout' ) { if ( $bikaro_default_layout == 'no_sidebar_full_width' ) { $content_width = 1140; /* pixels */ } elseif ( ( $bikaro_default_layout == 'right_sidebar' ) || ( $bikaro_default_layout == 'left_sidebar' ) ) { $content_width = 840; /* pixels */ } else { $content_width = 540; /* pixels */ } } elseif ( $layout_meta == 'no_sidebar_full_width' ) { $content_width = 1140; /* pixels */ } elseif ( ( $layout_meta == 'right_sidebar' ) || ( $layout_meta == 'left_sidebar' ) ) { $content_width = 840; /* pixels */ } else { $content_width = 540; /* pixels */ } } add_action( 'template_redirect', 'bikaro_content_width' ); add_action( 'after_setup_theme', 'bikaro_setup' ); /** * All setup functionalities. * * @since 1.0 */ if( !function_exists( 'bikaro_setup' ) ) : function bikaro_setup() { /* * Make theme available for translation. * Translations can be filed in the /languages/ directory. */ load_theme_textdomain( 'bikaro', get_template_directory() . '/languages' ); // Add default posts and comments RSS feed links to head add_theme_support( 'automatic-feed-links' ); // This theme uses Featured Images (also known as post thumbnails) for per-post/per-page. add_theme_support( 'post-thumbnails' ); // Registering navigation menus. register_nav_menus( array( 'social' => esc_html__( 'Social Menu', 'bikaro' ), 'primary' => esc_html__( 'Primary Menu', 'bikaro' ), 'footer' => esc_html__( 'Footer Menu', 'bikaro' ), ) ); // Cropping the images to different sizes to be used in the theme add_image_size( 'bikaro-featured-blog-medium', 270, 270, true ); add_image_size( 'bikaro-featured', 750, 310, true ); add_image_size( 'bikaro-services', 360, 240, true ); // Setup the WordPress core custom background feature. add_theme_support( 'custom-background', apply_filters( 'bikaro_custom_background_args', array( 'default-color' => 'f0f0f0' ) ) ); /* * Let WordPress manage the document title. * By adding theme support, we declare that this theme does not use a * hard-coded tag in the document head, and expect WordPress to * provide it for us. */ add_theme_support('title-tag'); // Enable support for Post Formats. add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link', 'gallery', 'chat', 'audio', 'status' ) ); /* * 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', 'gallery', 'caption', )); // Adding excerpt option box for pages as well add_post_type_support( 'page', 'excerpt' ); } endif; /** * Define Directory Location Constants */ define( 'bikaro_PARENT_DIR', get_template_directory() ); define( 'bikaro_CHILD_DIR', get_stylesheet_directory() ); define( 'bikaro_INCLUDES_DIR', bikaro_PARENT_DIR. '/inc' ); define( 'bikaro_CSS_DIR', bikaro_PARENT_DIR . '/css' ); define( 'bikaro_JS_DIR', bikaro_PARENT_DIR . '/js' ); define( 'bikaro_LANGUAGES_DIR', bikaro_PARENT_DIR . '/languages' ); define( 'bikaro_ADMIN_DIR', bikaro_INCLUDES_DIR . '/admin' ); define( 'bikaro_WIDGETS_DIR', bikaro_INCLUDES_DIR . '/widgets' ); define( 'bikaro_ADMIN_IMAGES_DIR', bikaro_ADMIN_DIR . '/images' ); define( 'bikaro_ADMIN_CSS_DIR', bikaro_ADMIN_DIR . '/css' ); /** * Define URL Location Constants */ define( 'bikaro_PARENT_URL', get_template_directory_uri() ); define( 'bikaro_CHILD_URL', get_stylesheet_directory_uri() ); define( 'bikaro_INCLUDES_URL', bikaro_PARENT_URL. '/inc' ); define( 'bikaro_CSS_URL', bikaro_PARENT_URL . '/css' ); define( 'bikaro_JS_URL', bikaro_PARENT_URL . '/js' ); define( 'bikaro_LANGUAGES_URL', bikaro_PARENT_URL . '/languages' ); define( 'bikaro_ADMIN_URL', bikaro_INCLUDES_URL . '/admin' ); define( 'bikaro_WIDGETS_URL', bikaro_INCLUDES_URL . '/widgets' ); define( 'bikaro_ADMIN_IMAGES_URL', bikaro_ADMIN_URL . '/images' ); define( 'bikaro_ADMIN_CSS_URL', bikaro_ADMIN_URL . '/css' ); /** Load functions */ require_once( bikaro_INCLUDES_DIR . '/custom-header.php' ); require_once( bikaro_INCLUDES_DIR . '/functions.php' ); require_once( bikaro_INCLUDES_DIR . '/customizer.php' ); require_once( bikaro_INCLUDES_DIR . '/header-functions.php' ); require_once( bikaro_ADMIN_DIR . '/meta-boxes.php' ); /** Load Widgets and Widgetized Area */ require_once( bikaro_WIDGETS_DIR . '/widgets.php' ); ?>