'sidebar',
'name' => esc_html__( 'Sidebar' , 'billiard'),
'before_widget' => '
',
'before_title' => '',
'after_title' => '
',
'description' => esc_html__( 'Drag the widgets for sidebars.', 'billiard')
)
);
// register footer sidebars
register_sidebar(
array(
'id' => 'footer-sidebar',
'name' => esc_html__( 'Footer sidebar' , 'billiard'),
'before_widget' => '',
'before_title' => '',
'after_title' => '
',
'description' => esc_html__( 'Drag the widgets for sidebars.', 'billiard')
)
);
}
/**
* @ return null
* @ param none
* @ loads all the js and css script to frontend
**/
function billiard_enqueue_scripts() {
// general settings
if( ( is_admin() ) ) { return; }
wp_enqueue_script( 'fitvids', BILLIARD_URI . '/assets/js/jquery.fitvids.js', array( 'jquery' ), false, true );
wp_enqueue_script( 'isotope', BILLIARD_URI . '/assets/js/isotope.pkgd.min.js', array( 'jquery' ), false, true );
wp_enqueue_script( 'magnific-popup', BILLIARD_URI . '/assets/js/jquery.magnific-popup.min.js', array( 'jquery' ), false, true );
wp_enqueue_script( 'wow', BILLIARD_URI . '/assets/js/wow.min.js', array( 'jquery' ), false, true );
wp_enqueue_script( 'lightgallery', BILLIARD_URI . '/assets/js/lightgallery.js', array( 'jquery' ), false, true );
wp_enqueue_script( 'idangerous', BILLIARD_URI . '/assets/js/idangerous.swiper.min.js', array( 'jquery' ), false, true );
wp_enqueue_script( 'billiard-all-js', BILLIARD_URI . '/assets/js/all.js', array( 'jquery' ), false, true );
// add TinyMCE style
add_editor_style();
// including jQuery plugins
wp_localize_script('jquery-scripts', 'get',
array(
'ajaxurl' => admin_url( 'admin-ajax.php' ),
'siteurl' => get_template_directory_uri()
)
);
if ( is_singular() ) {
wp_enqueue_script( 'comment-reply' );
}
wp_enqueue_style( 'font-et-line', BILLIARD_URI . '/assets/css/font.css' );
// register style
wp_enqueue_style( 'billiard-core', BILLIARD_URI . '/style.css' );
wp_enqueue_style( 'billiard-fonts', billiard_fonts_url(), array() );
wp_enqueue_style( 'font-awesome.', BILLIARD_URI . '/assets/css/font-awesome.min.css' );
wp_enqueue_style( 'bootstrap', BILLIARD_URI . '/assets/css/bootstrap.min.css' );
wp_enqueue_style( 'magnific-popup', BILLIARD_URI . '/assets/css/magnific-popup.css' );
wp_enqueue_style( 'lightgallery', BILLIARD_URI . '/assets/css/lightgallery.min.css' );
wp_enqueue_style( 'animate', BILLIARD_URI . '/assets/css/animate.css' );
wp_enqueue_style( 'unit-test', BILLIARD_URI . '/assets/css/unit-test.css' );
wp_enqueue_style( 'billiard-styles', BILLIARD_URI . '/assets/css/styles.css', array(), time() );
wp_enqueue_style( 'billiard_dynamic-css', admin_url( 'admin-ajax.php' ) . '?action=billiard_dynamic_css', '', false );
}
/**
* Include plugins
**/
function billiard_include_required_plugins() {
$plugins = array(
array(
'name' => esc_html__( 'Contact Form 7', 'billiard' ), // The plugin name
'slug' => 'contact-form-7', // The plugin slug (typically the folder name)
'required' => false, // If false, the plugin is only 'recommended' instead of required
'version' => '', // E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented
'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch
'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins
'external_url' => '', // If set, overrides default API URL and points to an external URL
),
array(
'name' => esc_html__( 'Visual Composer', 'billiard' ), // The plugin name
'slug' => 'js_composer', // The plugin slug (typically the folder name)
'source' => esc_url( 'http://download-plugins.viewdemo.co/premium-plugins/js_composer.zip' ), // The plugin source
'required' => true, // If false, the plugin is only 'recommended' instead of required
'version' => '', // E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented
'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch
'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins
'external_url' => '', // If set, overrides default API URL and points to an external URL
),
array(
'name' => esc_html__( 'Modern Events Calendar', 'billiard' ), // The plugin name
'slug' => 'events_calendar', // The plugin slug (typically the folder name)
'source' => esc_url( 'http://download-plugins.viewdemo.co/premium-plugins/modern-events-calendar.zip' ), // The plugin source
'required' => true, // If false, the plugin is only 'recommended' instead of required
'version' => '', // E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented
'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch
'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins
'external_url' => '', // If set, overrides default API URL and points to an external URL
),
array(
'name' => esc_html__( 'Booked Appointments', 'billiard' ),
// The plugin name
'slug' => 'booked',
// The plugin slug (typically the folder name)
'source' => esc_url( 'http://download-plugins.viewdemo.co/premium-plugins/booked.zip' ),
// The plugin source
'required' => false,
// If false, the plugin is only 'recommended' instead of required
'version' => '',
// E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented
'force_activation' => false,
// If true, plugin is activated upon theme activation and cannot be deactivated until theme switch
'force_deactivation' => false,
// If true, plugin is deactivated upon theme switch, useful for theme-specific plugins
'external_url' => '',
// If set, overrides default API URL and points to an external URL
),
array(
'name' => esc_html__( 'UpQode Google Map', 'billiard' ),
// The plugin name
'slug' => 'upqode-google-maps',
// The plugin slug (typically the folder name)
'source' => '',
// The plugin source
'required' => false,
// If false, the plugin is only 'recommended' instead of required
'version' => '',
// E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented
'force_activation' => false,
// If true, plugin is activated upon theme activation and cannot be deactivated until theme switch
'force_deactivation' => false,
// If true, plugin is deactivated upon theme switch, useful for theme-specific plugins
'external_url' => '',
// If set, overrides default API URL and points to an external URL
),
array(
'name' => esc_html__( 'Image Map Pro', 'billiard' ), // The plugin name
'slug' => 'image_map_pro', // The plugin slug (typically the folder name)
'source' => esc_url( 'http://download-plugins.viewdemo.co/premium-plugins/image-map-pro-wordpress.zip' ), // The plugin source
'required' => true, // If false, the plugin is only 'recommended' instead of required
'version' => '', // E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented
'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch
'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins
'external_url' => '', // If set, overrides default API URL and points to an external URL
),
array(
'name' => esc_html__( 'billiard Plugins', 'billiard' ), // The plugin name
'slug' => 'billiard-plugins', // The plugin slug (typically the folder name)
'source' => esc_url( 'http://download-plugins.viewdemo.co/billiard/billiard-plugins.zip' ), // The plugin source
'required' => true, // If false, the plugin is only 'recommended' instead of required
'version' => '1.0.0', // E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented
'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch
'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins
'external_url' => '', // If set, overrides default API URL and points to an external URL
),
array(
'name' => esc_html__( 'Woocommerce', 'billiard' ), // The plugin name
'slug' => 'woocommerce', // The plugin slug (typically the folder name)
'required' => false, // If false, the plugin is only 'recommended' instead of required
'version' => '', // E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented
'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch
'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins
'external_url' => '', // If set, overrides default API URL and points to an external URL
),
);
// Change this to your theme text domain, used for internationalising strings
/**
* Array of configuration settings. Amend each line as needed.
* If you want the default strings to be available under your own theme domain,
* leave the strings uncommented.
* Some of the strings are added into a sprintf, so see the comments at the
* end of each line for what each argument will be.
*/
$config = array(
'domain' => 'billiard', // Text domain - likely want to be the same as your theme.
'default_path' => '', // Default absolute path to pre-packaged plugins
'menu' => 'tgmpa-install-plugins', // Menu slug
'has_notices' => true, // Show admin notices or not
'is_automatic' => true, // Automatically activate plugins after installation or not
'message' => '', // Message to output right before the plugins table
'strings' => array(
'page_title' => esc_html__( 'Install Required Plugins', 'billiard' ),
'menu_title' => esc_html__( 'Install Plugins', 'billiard' ),
'installing' => esc_html__( 'Installing Plugin: %s', 'billiard' ), // %1$s = plugin name
'oops' => esc_html__( 'Something went wrong with the plugin API.', 'billiard' ),
'notice_can_install_required' => _n_noop( 'This theme requires the following plugin: %1$s.', 'This theme requires the following plugins: %1$s.', 'billiard' ), // %1$s = plugin name(s)
'notice_can_install_recommended' => _n_noop( 'This theme recommends the following plugin: %1$s.', 'This theme recommends the following plugins: %1$s.', 'billiard' ), // %1$s = plugin name(s)
'notice_cannot_install' => _n_noop( 'Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.', 'billiard' ), // %1$s = plugin name(s)
'notice_can_activate_required' => _n_noop( 'The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.', 'billiard' ), // %1$s = plugin name(s)
'notice_can_activate_recommended' => _n_noop( 'The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.', 'billiard' ), // %1$s = plugin name(s)
'notice_cannot_activate' => _n_noop( 'Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.', 'billiard' ), // %1$s = plugin name(s)
'notice_ask_to_update' => _n_noop( 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.', 'billiard' ), // %1$s = plugin name(s)
'notice_cannot_update' => _n_noop( 'Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.', 'billiard' ), // %1$s = plugin name(s)
'install_link' => _n_noop( 'Begin installing plugin', 'Begin installing plugins', 'billiard' ),
'activate_link' => _n_noop( 'Activate installed plugin', 'Activate installed plugins', 'billiard' ),
'return' => esc_html__( 'Return to Required Plugins Installer', 'billiard' ),
'plugin_activated' => esc_html__( 'Plugin activated successfully.', 'billiard' ),
'complete' => esc_html__( 'All plugins installed and activated successfully. %s', 'billiard' ), // %1$s = dashboard link
'nag_type' => 'updated' // Determines admin notice type - can only be 'updated' or 'error'
)
);
tgmpa( $plugins, $config );
}
/*
* Custom styles from Theme Options.
*/
function billiard_custom_styles() {
$billiard = billiard_site_options();
$output = '';
/* Custom menu typography */
if( isset( $billiard['default_menu_style'] ) && ! $billiard['default_menu_style'] ) {
$typo = $billiard['menu_typography_group'];
if( ! empty( $typo['menu_typography']['family'] ) ) {
$output .= '.right-menu-link a, nav ul li a {font-family:' . $typo['menu_typography']['family'] . ';}' . "\n\r";
if( $typo['menu_typography']['font'] == 'google' ) {
wp_enqueue_style( 'menu_typography', '//fonts.googleapis.com/css?family=' . $typo['menu_typography']['family'] . ':' . $typo['menu_typography']['variant'] );
}
}
if( ! empty( $typo['menu_font_size'] ) ) {
$output .= '.right-menu-link a, nav ul li a {font-size:' . $typo['menu_font_size'] . 'px;}' . "\n\r";
}
if( ! empty( $typo['menu_font_color'] ) ) {
$output .= '.right-menu-link a, nav ul li a {color:' . $typo['menu_font_color'] . ';}' . "\n\r";
}
}
/* Custom CSS styles */
if( ! empty( $billiard['custom_css_styles'] ) ) {
$output .= $billiard['custom_css_styles'];
}
/* Text Logo font size */
if( ! empty( $billiard['text_logo_font_size'] ) ) {
$output .= '.logo a{font-size:' . $billiard['text_logo_font_size'];
$output .= ( is_numeric( $billiard['text_logo_font_size'] ) ) ? 'px;}' : ';}';
$output .= "\n\r";
}
if( ! empty( $billiard['logo_height'] ) ) {
$output .= 'header, .logo {height:' . $billiard['logo_height'];
$output .= ( is_numeric( $billiard['logo_height'] ) ) ? 'px;}' : ';}';
$output .= "\n\r";
$output .= '.logo a {line-height:' . $billiard['logo_height'];
$output .= ( is_numeric( $billiard['logo_height'] ) ) ? 'px;}' : ';}';
$output .= "\n\r";
$output .= '.page-body{margin-top:' . $billiard['logo_height'];
$output .= ( is_numeric( $billiard['logo_height'] ) ) ? 'px;}' : ';}';
$output .= "\n\r";
}
/* Footer styles */
if( ! empty( $billiard['footer_background_color'] ) ) {
$output .= 'footer{background-color: ' . $billiard['footer_background_color'] . ';}';
}
/* Footer social color */
if( ! empty( $billiard['footer_social_color'] ) ) {
$output .= 'footer .fa{color: ' . $billiard['footer_social_color'] . ';}';
}
/* Footer menu typography */
if( ! empty( $billiard['default_footer_typography'] ) && ! $billiard['default_footer_typography'] ) {
$typo = $billiard['footer_typography_group'];
if( ! empty( $typo['footer_typography']['family'] ) ) {
$output .= '.footer-link a {font-family:' . $typo['footer_typography']['family'] . ';}' . "\n\r";
if( $typo['footer_typography']['font'] == 'google' ) {
wp_enqueue_style( 'footer_typography', '//fonts.googleapis.com/css?family=' . $typo['footer_typography']['family'] . ':' . $typo['footer_typography']['variant'] );
}
}
if( ! empty( $typo['footer_font_size'] ) ) {
$output .= '.footer-link a {font-size:' . $typo['footer_font_size'] . 'px;}' . "\n\r";
}
if( ! empty( $typo['footer_font_color'] ) ) {
$output .= '.footer-link a {color:' . $typo['footer_font_color'] . ';}' . "\n\r";
}
}
/* Custom blog background color */
if( ! empty( $billiard['gray_blog'] ) && $billiard['gray_blog'] == 'bg-custom' && ! empty( $billiard['blog_bg_color'] ) ) {
$output .= '.main-wrapp.bg-custom{background-color: ' . $billiard['blog_bg_color'] . ';}' . "\n\r";
}
/* Custom CSS code */
if ( ! empty( $output ) ) {
wp_add_inline_style( 'billiard-styles', $output );
}
/* Custom JavaScript code */
if( ! empty( $billiard['custom_js_code'] ) ) {
if ( function_exists( 'wp_add_inline_script' ) ) {
wp_add_inline_script( 'billiard', $billiard['custom_js_code'] );
}
}
}
function wpc_regiser_etline_icons() {
wp_enqueue_style( 'font-et-line', BILLIARD_URI . '/assets/css/font.css' );
}
add_action( 'vc_base_register_admin_css', 'wpc_regiser_etline_icons' );
// wp_enqueue_style( 'et-line', billiard_URI . '/assets/css/font.css' );
if ( ! function_exists( 'billiard_et_line_icons' ) ) {
function billiard_et_line_icons() {
$array = array(
array( 'icon-adjustments' => 'Adjustments' ),
array( 'icon-alarmclock' => 'Alarmclock' ),
array( 'icon-anchor' => 'Anchor' ),
array( 'icon-aperture' => 'Aperture' ),
array( 'icon-attachment' => 'Attachment' ),
array( 'icon-bargraph' => 'Bargraph' ),
array( 'icon-basket' => 'Basket' ),
array( 'icon-beaker' => 'Beaker' ),
array( 'icon-bike' => 'Bike' ),
array( 'icon-book-open' => 'Book-open' ),
array( 'icon-briefcase' => 'Briefcase' ),
array( 'icon-browser' => 'Browser' ),
array( 'icon-calendar' => 'Calendar' ),
array( 'icon-camera' => 'Camera' ),
array( 'icon-caution' => 'Caution' ),
array( 'icon-chat' => 'Chat' ),
array( 'icon-circle-compass' => 'Circle-compass' ),
array( 'icon-clipboard' => 'Clipboard' ),
array( 'icon-clock' => 'Clock' ),
array( 'icon-cloud' => 'Cloud' ),
array( 'icon-compass' => 'Compass' ),
array( 'icon-desktop' => 'Desktop' ),
array( 'icon-dial' => 'Dial' ),
array( 'icon-document' => 'Document' ),
array( 'icon-documents' => 'Documents' ),
array( 'icon-download' => 'Download' ),
array( 'icon-dribbble' => 'Dribbble' ),
array( 'icon-edit' => 'Edit' ),
array( 'icon-envelope' => 'Envelope' ),
array( 'icon-expand' => 'Expand' ),
array( 'icon-facebook' => 'Facebook' ),
array( 'icon-flag' => 'Flag' ),
array( 'icon-focus' => 'Focus' ),
array( 'icon-gears' => 'Gears' ),
array( 'icon-genius' => 'Genius' ),
array( 'icon-gift' => 'Gift' ),
array( 'icon-global' => 'Global' ),
array( 'icon-globe' => 'Globe' ),
array( 'icon-googleplus' => 'Googleplus' ),
array( 'icon-grid' => 'Grid' ),
array( 'icon-happy' => 'Happy' ),
array( 'icon-hazardous' => 'Hazardous' ),
array( 'icon-heart' => 'Heart' ),
array( 'icon-hotairballoon' => 'Hotairballoon' ),
array( 'icon-hourglass' => 'Hourglass' ),
array( 'icon-key' => 'Key' ),
array( 'icon-laptop' => 'Laptop' ),
array( 'icon-layers' => 'Layers' ),
array( 'icon-lifesaver' => 'Lifesaver' ),
array( 'icon-lightbulb' => 'Lightbulb' ),
array( 'icon-linegraph' => 'Linegraph' ),
array( 'icon-linkedin' => 'Linkedin' ),
array( 'icon-lock' => 'Lock' ),
array( 'icon-magnifying-glass' => 'Magnifying-glass' ),
array( 'icon-map' => 'Map' ),
array( 'icon-map-pin' => 'Map-pin' ),
array( 'icon-megaphone' => 'Megaphone' ),
array( 'icon-mic' => 'Mic' ),
array( 'icon-mobile' => 'Mobile' ),
array( 'icon-newspaper' => 'Newspaper' ),
array( 'icon-notebook' => 'Notebook' ),
array( 'icon-paintbrush' => 'Paintbrush' ),
array( 'icon-paperclip' => 'Paperclip' ),
array( 'icon-pencil' => 'Pencil' ),
array( 'icon-phone' => 'Phone' ),
array( 'icon-picture' => 'Picture' ),
array( 'icon-pictures' => 'Pictures' ),
array( 'icon-piechart' => 'Piechart' ),
array( 'icon-presentation' => 'Presentation' ),
array( 'icon-pricetags' => 'Pricetags' ),
array( 'icon-printer' => 'Printer' ),
array( 'icon-profile-female' => 'Profile-female' ),
array( 'icon-profile-male' => 'Profile-male' ),
array( 'icon-puzzle' => 'Puzzle' ),
array( 'icon-quote' => 'Quote' ),
array( 'icon-recycle' => 'Recycle' ),
array( 'icon-refresh' => 'Refresh' ),
array( 'icon-ribbon' => 'Ribbon' ),
array( 'icon-rss' => 'Rss' ),
array( 'icon-sad' => 'Sad' ),
array( 'icon-scissors' => 'Scissors' ),
array( 'icon-scope' => 'Scope' ),
array( 'icon-search' => 'Search' ),
array( 'icon-shield' => 'Shield' ),
array( 'icon-speedometer' => 'Speedometer' ),
array( 'icon-strategy' => 'Strategy' ),
array( 'icon-streetsign' => 'Streetsign' ),
array( 'icon-tablet' => 'Tablet' ),
array( 'icon-target' => 'Target' ),
array( 'icon-telescope' => 'Telescope' ),
array( 'icon-toolbox' => 'Toolbox' ),
array( 'icon-tools' => 'Tools' ),
array( 'icon-tools-2' => 'Tools-2' ),
array( 'icon-trophy' => 'Trophy' ),
array( 'icon-tumblr' => 'Tumblr' ),
array( 'icon-twitter' => 'Twitter' ),
array( 'icon-upload' => 'Upload' ),
array( 'icon-video' => 'Video' ),
array( 'icon-wallet' => 'Wallet' ),
array( 'icon-wine' => 'Wine' )
);
return $array;
}
}