__( 'Primary Menu', 'bizworx' )
) );
// Content width
global $content_width;
if ( ! isset( $content_width ) ) {
$content_width = 1170;
}
/*
* Enable support for Post Formats.
* See http://codex.wordpress.org/Post_Formats
*/
add_theme_support( 'post-formats', array(
'aside',
'image',
'video',
'quote',
'link',
) );
// Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
/*
* 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' );
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'bizworx_custom_background_args', array(
'default-color' => 'ffffff',
'default-image' => '',
) ) );
/*
* 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',
) );
// Add theme support for Custom Logo.
add_theme_support( 'custom-logo', array(
'width' => 250,
'height' => 250,
'flex-width' => true,
) );
}
endif;
add_action( 'after_setup_theme', 'bizworx_setup' );
function bizworx_preloader() {
?>
%2$s';
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
$time_string = '%2$s %4$s ';
}
$time_string = sprintf( $time_string,
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() ),
esc_attr( get_the_modified_date( 'c' ) ),
esc_html( get_the_modified_date() )
);
$posted_on = sprintf(
_x( '%s', 'post date', 'bizworx' ),
'' . $time_string . ' '
);
$byline = sprintf(
_x( '%s', 'post author', 'bizworx' ),
'' . esc_html( get_the_author() ) . ' '
);
$tags = get_the_tags();
$singletag = '';
$tagsline = '';
if( $tags) :
foreach( $tags as $tag ){
$singletag .= ''. esc_html( $tag->name ) .' ';
}
$tagsline = ''.$singletag.' ';
endif;
$category = get_the_category();
$singlecategory = '';
$categoryline = '';
if($category) :
foreach( $category as $cat ){
$singlecategory .= ''. esc_html( $cat->name ) .' ';
}
$categoryline = '' . $singlecategory . ' ';
endif;
echo '' . $posted_on . ' ' . $byline . ' ' . $categoryline . $tagsline;
}
endif;
// Changing excerpt more
function bizworx_excerpt_more($more) {
global $post;
return '';
}
add_filter('excerpt_more', 'bizworx_excerpt_more');
/**
* Enqueue scripts and styles.
*/
function bizworx_scripts() {
wp_enqueue_style( 'bizworx-fonts', esc_url( bizworx_google_fonts() ), array(), null );
wp_enqueue_style( 'bizworx-style', get_stylesheet_uri() );
wp_enqueue_script( 'bizworx-main', get_template_directory_uri() . '/js/main.min.js', array('jquery'), '20180213', true );
wp_enqueue_script( 'owl.carousel.min', get_template_directory_uri() . '/js/owl.carousel.js', array('jquery'), '20180213', true );
wp_enqueue_style( 'bizworx-font-awesome', get_template_directory_uri() . '/fonts/font-awesome.min.css' );
wp_enqueue_style( 'owl.carousel', get_template_directory_uri() . '/css/owl.carousel.css' );
wp_enqueue_style( 'owl.theme', get_template_directory_uri() . '/css/owl.theme.css' );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'wp_enqueue_scripts', 'bizworx_scripts' );
/**
* Fonts
*/
if ( !function_exists('bizworx_google_fonts') ) :
function bizworx_google_fonts() {
$body_font = get_theme_mod('body_font_name', 'Poppins:400,600');
$headings_font = get_theme_mod('headings_font_name', 'Ubuntu:400,400i,500,500i');
$fonts = array();
$fonts[] = esc_attr( str_replace( '+', ' ', $body_font ) );
$fonts[] = esc_attr( str_replace( '+', ' ', $headings_font ) );
if ( $fonts ) {
$fonts_url = add_query_arg( array(
'family' => urlencode( implode( '|', $fonts ) )
), 'https://fonts.googleapis.com/css' );
}
return $fonts_url;
}
endif;
function bizworx_header_background() {
$title = get_theme_mod('header_title_1', 'Welcome to Bizworx');
$subtitle = get_theme_mod('header_subtitle_1', 'Feel free to look around');
$button_text = get_theme_mod('banner_button', 'Get started');
$button_url = get_theme_mod('banner_button_url', '#');
$front_header_type = get_theme_mod('front_header_type', 'image');
$site_header_type = get_theme_mod('site_header_type', 'image');
if ( ( $front_header_type == 'image' && is_front_page() || $site_header_type == 'image' && !is_front_page() ) ) :
?>
__( 'Sidebar', 'bizworx' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '',
'before_title' => '',
) );
//Footer widget areas
$widget_areas = get_theme_mod('footer_widget_areas', '3');
for ($i=1; $i<=$widget_areas; $i++) {
register_sidebar( array(
'name' => __( 'Footer ', 'bizworx' ) . $i,
'id' => 'footer-' . $i,
'description' => '',
'before_widget' => '',
'before_title' => '',
) );
}
}
add_action( 'widgets_init', 'bizworx_widgets_init' );
/**
* Enqueue Bootstrap
*/
function bizworx_enqueue_bootstrap() {
wp_enqueue_style( 'bizworx-bootstrap', get_template_directory_uri() . '/css/bootstrap/bootstrap.min.css', array(), true );
}
add_action( 'wp_enqueue_scripts', 'bizworx_enqueue_bootstrap', 9 );
/**
* Custom-Header
*/
require get_template_directory() . '/inc/custom-header.php';
/**
* Customizer additions.
*/
require get_template_directory() . '/inc/customizer.php';
/**
* Styles
*/
require get_template_directory() . '/inc/styles.php';
/**
* Upsell
*/
require get_template_directory() . '/upsell/class-customize.php';
/**
* Demo content
*/
require_once dirname( __FILE__ ) . '/demo-content/demo-content-setup.php';
/**
* Carousel slider
*/
require get_template_directory() . '/recommend/class-tgm-plugin-activation.php';
function bizworx_recommend_plugin() {
if ( !defined( 'SITEORIGIN_PANELS_VERSION' ) ) {
$plugins[] = array(
'name' => 'Elementor',
'slug' => 'elementor',
'required' => false,
);
}
$plugins[] = array(
'name' => 'Contact Form 7',
'slug' => 'contact-form-7',
'required' => false,
);
$plugins[] = array(
'name' => 'Bizworx Tools',
'slug' => 'bizworx-tools',
'required' => false,
);
tgmpa( $plugins);
}
add_action( 'tgmpa_register', 'bizworx_recommend_plugin' );
/**
* Admin notice
*/
require get_template_directory() . '/notices/persist-admin-notices-dismissal.php';
if ( ! function_exists( 'bizworx_edit_link' ) ) :
/**
* Returns an accessibility-friendly link to edit a post or page.
*
* This also gives us a little context about what exactly we're editing
* (post or page?) so that users understand a bit more where they are in terms
* of the template hierarchy and their content. Helpful when/if the single-page
* layout with multiple posts/pages shown gets confusing.
*/
function bizworx_edit_link() {
edit_post_link(
sprintf(
/* translators: %s: Name of current post */
__( ' Edit "%s" ', 'bizworx' ),
get_the_title()
),
'',
' '
);
}
endif;