__( 'Primary Menu', 'biznesspack' ),
'social' => __( 'Social Links Menu', 'biznesspack' ),
) );
//Switch default core markup for search form, comment form, and comments to output valid HTML5.
add_theme_support( 'html5', array(
'comment-form',
'comment-list',
'gallery',
'caption',
) );
// Enable support for Post Formats.
add_theme_support( 'post-formats', array(
'aside',
'image',
'video',
'quote',
'link',
'gallery',
'audio',
) );
// Add theme support for Custom Logo.
add_theme_support( 'custom-logo', array(
'width' => 250,
'height' => 250,
'flex-width' => true,
) );
// Add theme support for selective refresh for widgets.
add_theme_support( 'customize-selective-refresh-widgets' );
/*
* This theme styles the visual editor to resemble the theme style,
* specifically font, colors, and column width.
*/
add_editor_style( array( 'assets/css/editor-style.css', biznesspack_fonts_url() ) );
// Add theme support for Custom Background.
$args = array(
'default-color' => '#ffffff',
'default-image' =>''
);
add_theme_support( 'custom-background', $args );
$args = array(
'flex-width' => true,
'width' => 1600,
'flex-height' => true,
'height' => 750,
'default-text-color' => '',
'default-image' => get_template_directory_uri() . '/assets/images/header.jpg',
'wp-head-callback' => 'biznesspack_header_style',
);
register_default_headers( array(
'default-image' => array(
'url' => '%s/assets/images/header.jpg',
'thumbnail_url' => '%s/assets/images/header.jpg',
'description' => __( 'Default Header Image', 'biznesspack' ),
),
) );
add_theme_support( 'custom-header', $args );
}
add_action( 'after_setup_theme', 'biznesspack_setup' );
/**
* Set the content width in pixels, based on the theme's design and stylesheet.
* @global int $content_width
*/
function biznesspack_content_width() {
$content_width = $GLOBALS['content_width'];
// Get layout.
$page_layout = get_theme_mod( 'page_layout' );
// Check if layout is one column.
if ( 'one-column' === $page_layout ) {
if ( biznesspack_is_frontpage() ) {
$content_width = 644;
} elseif ( is_page() ) {
$content_width = 740;
}
}
// Check if is single post and there is no sidebar.
if ( is_single() && ! is_active_sidebar( 'sidebar-1' ) ) {
$content_width = 740;
}
/**
* Filter Biznesspack content width of the theme.
* @param int $content_width Content width in pixels.
*/
$GLOBALS['content_width'] = apply_filters( 'biznesspack_content_width', $content_width );
}
add_action( 'template_redirect', 'biznesspack_content_width', 0 );
/**
* Add preconnect for Google Fonts.
* @param array $urls URLs to print for resource hints.
* @param string $relation_type The relation type the URLs are printed.
* @return array $urls URLs to print for resource hints.
*/
function biznesspack_resource_hints( $urls, $relation_type ) {
if ( wp_style_is( 'biznesspack-fonts', 'queue' ) && 'preconnect' === $relation_type ) {
$urls[] = array(
'href' => 'https://fonts.gstatic.com',
'crossorigin',
);
}
return $urls;
}
add_filter( 'wp_resource_hints', 'biznesspack_resource_hints', 10, 2 );
/**
* Register widget areas.
*/
function biznesspack_widgets_init() {
register_sidebar( array(
'name' => __( 'Blog Sidebar', 'biznesspack' ),
'id' => 'sidebar-1',
'description' => __( 'Add widgets here to appear in your sidebar on blog posts and archive pages.', 'biznesspack' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => '
',
'after_title' => '
',
) );
register_sidebar( array(
'name' => __( 'Footer 1', 'biznesspack' ),
'id' => 'footer-1',
'description' => __( 'Add widgets here to appear in your footer.', 'biznesspack' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => '
',
'after_title' => '
',
) );
register_sidebar( array(
'name' => __( 'Footer 2', 'biznesspack' ),
'id' => 'footer-2',
'description' => __( 'Add widgets here to appear in your footer.', 'biznesspack' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => '
',
'after_title' => '
',
) );
register_sidebar( array(
'name' => __( 'Footer 3', 'biznesspack' ),
'id' => 'footer-3',
'description' => __( 'Add widgets here to appear in your footer.', 'biznesspack' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => '
',
'after_title' => '
',
) );
register_sidebar( array(
'name' => __( 'Footer 4', 'biznesspack' ),
'id' => 'footer-4',
'description' => __( 'Add widgets here to appear in your footer.', 'biznesspack' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => '
',
'after_title' => '
',
) );
}
add_action( 'widgets_init', 'biznesspack_widgets_init' );
/**
* Replaces "[...]" (appended to automatically generated excerpts) with ... and
* a 'Continue reading' link.
* @param string $link Link to single post/page.
* @return string 'Continue reading' link prepended with an ellipsis.
*/
function biznesspack_excerpt_more( $link ) {
if ( is_admin() ) {
return $link;
}
return sprintf( '