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('bubu-full-width', 1038, 576, true); add_image_size('bubu-portfolio-image', 320, 260, true); // Bubu theme uses wp_nav_menu() in two locations. register_nav_menus(array( 'primary' => __('Header Menu', 'bubu'), 'secondary' => __('Footer Menu', 'bubu'), )); //custom background add_theme_support( 'custom-background', apply_filters( 'bubu_custom_background_args', array( 'default-color' => 'f5f5f5', ) ) ); /* * 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' => 'bubu_get_featured_posts', 'max_posts' => 6, )); // Bubu theme uses its own gallery styles. add_filter('use_default_gallery_style', '__return_false'); } endif; // bubu_setup add_action('after_setup_theme', 'bubu_setup'); /** Register Lato Google font for bubu theme.*/ function bubu_font_url() { $bubu_font_url = ''; if ('off' !== _x('on', 'Lato font: on or off', 'bubu')) { $bubu_font_url = add_query_arg('family', urlencode('Lato:300,400,700,900,300italic,400italic,700italic'), "//fonts.googleapis.com/css"); } return $bubu_font_url; } // thumbnail list function bubu_thumbnail_image($content) { if (has_post_thumbnail()) return the_post_thumbnail('thumbnail'); } /* * Set Theme Option variable as a global */ $bubu_options = get_option('bubu_theme_options'); global $bubu_options; /** Register widget areas.*/ function bubu_widgets_init() { register_sidebar(array( 'name' => __('Primary Sidebar', 'bubu'), 'id' => 'sidebar-1', 'description' => __('Main sidebar that appears on the right.', 'bubu'), 'before_widget' => '', 'before_title' => '', )); register_sidebar(array( 'name' => __('Footer Area One', 'bubu'), 'id' => 'footer-1', 'description' => __('Footer Area One that appears on the footer.', 'bubu'), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

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

', 'after_title' => '

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

', 'after_title' => '

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

', 'after_title' => '

', )); } add_action('widgets_init', 'bubu_widgets_init'); /* Add default menu style if menu is not set from the backend.*/ function bubu_add_menuid($page_markup) { preg_match('/^
/i', $page_markup, $bubu_matches); $bubu_divclass = ''; if (!empty($bubu_matches)) { $bubu_divclass = $bubu_matches[1]; } $bubu_toreplace = array('
', '
'); $bubu_replace = array(''); $bubu_new_markup = str_replace($bubu_toreplace, $bubu_replace, $page_markup); $bubu_new_markup = preg_replace('/