tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
/*
* Enable support for Post Thumbnails on posts and pages.
*
* @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
*/
add_theme_support( 'post-thumbnails' );
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'main-menu' => esc_html__( 'Main Menu', 'advkt' ),
'footer-menu' => esc_html__( 'Footer Menu', 'advkt' )
) );
/*
* 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',
) );
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'advkt_custom_background_args', array(
'default-color' => 'ffffff',
'default-image' => '',
) ) );
// Add theme support for selective refresh for widgets.
add_theme_support( 'customize-selective-refresh-widgets' );
/**
* Enable custom header
*/
add_theme_support('custom-header');
/**
* Add support for core custom logo.
*
* @link https://codex.wordpress.org/Theme_Logo
*/
add_theme_support( 'custom-logo', array(
'height' => 250,
'width' => 250,
'flex-width' => true,
'flex-height' => true,
) );
/**
* Enable suporrt for Post Formats
*
* see: https://codex.wordpress.org/Post_Formats
*/
add_theme_support( 'post-formats', array(
'image',
'audio',
'video',
'gallery',
'quote',
) );
// Add theme support for selective refresh for widgets.
add_theme_support( 'customize-selective-refresh-widgets' );
// Add support for Block Styles.
add_theme_support( 'wp-block-styles' );
// Add support for full and wide align images.
add_theme_support( 'align-wide' );
// Add support for editor styles.
add_theme_support( 'editor-styles' );
// Add support for responsive embedded content.
add_theme_support( 'responsive-embeds' );
// Editor style css
add_editor_style( 'css/theme-editor-style.css' );
}
endif;
add_action( 'after_setup_theme', 'advkt_setup' );
/**
* Set the content width in pixels, based on the theme's design and stylesheet.
*
* Priority 0 to make it available to lower priority callbacks.
*
* @global int $content_width
*/
function advkt_content_width() {
// This variable is intended to be overruled from themes.
// Open WPCS issue: {@link https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/1043}.
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
$GLOBALS['content_width'] = apply_filters( 'advkt_content_width', 640 );
}
add_action( 'after_setup_theme', 'advkt_content_width', 0 );
/**
* Register widget area.
*
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
function advkt_widgets_init() {
/**
* blog sidebar
*/
register_sidebar( array(
'name' => esc_html__( 'Right Sidebar', 'advkt' ),
'id' => 'right-sidebar',
'description' => esc_html__( 'Add widgets here.', 'advkt' ),
'before_widget' => '
',
'after_widget' => '
',
'before_title' => '',
) );
/**
* Footer Widget Style 1 er 1st Widget
*/
register_sidebar( array(
'name' => esc_html__( 'Footer Top Widget : Style 1', 'advkt' ),
'id' => 'fws-oner-top-widget',
'description' => esc_html__( '1st Widget of Footer Widget Style 1', 'advkt' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '',
) );
/**
* Footer Widget Style 1 er 1st Widget
*/
register_sidebar( array(
'name' => esc_html__( 'Footer Top Widget : Style 2', 'advkt' ),
'id' => 'fws-two-top-widget',
'description' => esc_html__( '2nd Widget of Footer Widget Style 1', 'advkt' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '',
) );
/**
* Footer Widget Style 1 er 1st Widget
*/
register_sidebar( array(
'name' => esc_html__( 'Footer Widget Style 1 : About Us', 'advkt' ),
'id' => 'footer-about-us-widget',
'description' => esc_html__( '1st Widget of Footer Widget Style 1', 'advkt' ),
'before_widget' => '',
'before_title' => '',
) );
/**
* Footer Widget Style 1 er 2nd Widget
*/
register_sidebar( array(
'name' => esc_html__( 'Footer Widget Style 1 : Usefull Links', 'advkt' ),
'id' => 'footer-userfull-links-widget',
'description' => esc_html__( '1st Widget of Footer Widget Style 1', 'advkt' ),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
) );
/**
* Footer Widget Style 1 er 3rd Widget
*/
register_sidebar( array(
'name' => esc_html__( 'Footer Widget Style 1 : Company', 'advkt' ),
'id' => 'footer-company-widget',
'description' => esc_html__( '3rd Widget of Footer Widget Style 1', 'advkt' ),
'before_widget' => '',
'before_title' => '',
) );
/**
* Footer Widget Style 1 er 4th Widget
*/
register_sidebar( array(
'name' => esc_html__( 'Footer Widget Style 1 : Opening Hours', 'advkt' ),
'id' => 'footer-contact-info-widget',
'description' => esc_html__( '4th Widget of Footer Widget Style 1', 'advkt' ),
'before_widget' => '',
'before_title' => '',
) );
/**
* Footer Widget Style 2 er 1st Widget
*/
register_sidebar( array(
'name' => esc_html__( 'Footer Widget Style 2 : About Us', 'advkt' ),
'id' => 'fws-2-er-1st-widget',
'description' => esc_html__( '1st Widget of Footer Widget Style 2', 'advkt' ),
'before_widget' => '',
'before_title' => '',
) );
/**
* Footer Widget Style 2 er 2nd Widget
*/
register_sidebar( array(
'name' => esc_html__( 'Footer Widget Style 2 : Company', 'advkt' ),
'id' => 'fws-2-er-second-widget',
'description' => esc_html__( '2nd Widget of Footer Widget Style 2', 'advkt' ),
'before_widget' => '',
'before_title' => '',
) );
/**
* Footer Widget Style 2 er 3rd Widget
*/
register_sidebar( array(
'name' => esc_html__( 'Footer Widget Style 2 : Solutions', 'advkt' ),
'id' => 'fws-2-er-third-widget',
'description' => esc_html__( '3rd Widget of Footer Widget Style 2', 'advkt' ),
'before_widget' => '',
'before_title' => '',
) );
/**
* Footer Widget Style 2 er 4th Widget
*/
register_sidebar( array(
'name' => esc_html__( 'Footer Widget Style 2 : News Letter', 'advkt' ),
'id' => 'fws-2-er-fourth-widget',
'description' => esc_html__( '4th Widget of Footer Widget Style 2', 'advkt' ),
'before_widget' => '',
'before_title' => '',
) );
/**
* Footer Widget Style 3 er 8th Widget
*/
register_sidebar( array(
'name' => esc_html__( 'Service Sidebar', 'advkt' ),
'id' => 'tc-service-widget',
'description' => esc_html__( '8th Widget of Footer Widget Style 3', 'advkt' ),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
'after_title' => '',
) );
}
add_action( 'widgets_init', 'advkt_widgets_init' );
/**
* Enqueue scripts and styles.
*/
define('ADVKT_THEME_DIR', get_template_directory() );
define('ADVKT_THEME_URI', get_template_directory_uri());
define('ADVKT_THEME_CSS_DIR', ADVKT_THEME_URI.'/css/');
define('ADVKT_THEME_JS_DIR', ADVKT_THEME_URI.'/js/');
define('ADVKT_THEME_INC', ADVKT_THEME_DIR.'/inc/');
/**
* advkt_scripts description
* @return [type] [description]
*/
function advkt_scripts() {
/**
* all css files
*/
wp_enqueue_style( 'advkt-fonts', advkt_fonts_url(), array(), '1.0.0' );
wp_enqueue_style( 'bootstrap', ADVKT_THEME_CSS_DIR.'bootstrap.min.css', array(), '5.2.3' );
wp_enqueue_style( 'fontawesome', ADVKT_THEME_CSS_DIR.'fontawesome.min.css', array(), '6.4.0' );
wp_enqueue_style( 'magnific-popup', ADVKT_THEME_CSS_DIR.'magnific-popup.min.css', array(), '1.0.0' );
wp_enqueue_style( 'slick', ADVKT_THEME_CSS_DIR.'slick.min.css', array(), '1.0.0' );
wp_enqueue_style( 'meanmenu', ADVKT_THEME_CSS_DIR.'meanmenu.min.css', array(), '2.0' );
wp_enqueue_style( 'nice-select', ADVKT_THEME_CSS_DIR.'nice-select.min.css', array() );
wp_enqueue_style( 'animate', ADVKT_THEME_CSS_DIR.'animate.min.css', array() );
wp_enqueue_style( 'advkt-main', ADVKT_THEME_CSS_DIR.'style.css', array(), '1.0.1' );
wp_enqueue_style( 'advkt-style', get_stylesheet_uri() );
// all js
wp_enqueue_script( 'bootstrap', ADVKT_THEME_JS_DIR.'bootstrap.min.js', array('jquery'), '', true );
wp_enqueue_script( 'jquery.nice-select', ADVKT_THEME_JS_DIR.'jquery.nice-select.min.js', array('jquery'), false, true );
wp_enqueue_script( 'slick', ADVKT_THEME_JS_DIR.'slick.min.js', array('jquery','imagesloaded'), false, true );
wp_enqueue_script( 'jquery.counterup', ADVKT_THEME_JS_DIR.'jquery.counterup.min.js', array('jquery'), false, true );
wp_enqueue_script( 'waypoints', ADVKT_THEME_JS_DIR.'waypoints.min.js', array('jquery'), false, true );
wp_enqueue_script( 'jquery.meanmenu', ADVKT_THEME_JS_DIR.'jquery.meanmenu.min.js', array('jquery'), false, true );
wp_enqueue_script( 'jquery.magnific-popup', ADVKT_THEME_JS_DIR.'jquery.magnific-popup.min.js', array('jquery'), false, true );
wp_enqueue_script( 'inview', ADVKT_THEME_JS_DIR.'inview.min.js', array('jquery'), false, true );
wp_enqueue_script( 'wow', ADVKT_THEME_JS_DIR.'wow.min.js', array('jquery'), '', true );
wp_enqueue_script( 'tilt.jquery', ADVKT_THEME_JS_DIR.'tilt.jquery.min.js', array('jquery'), '', true );
wp_enqueue_script( 'isotope', ADVKT_THEME_JS_DIR.'isotope.min.js', array('jquery'), '', true );
wp_enqueue_script( 'jquery.lettering', ADVKT_THEME_JS_DIR.'jquery.lettering.min.js', array('jquery'), '', true );
wp_enqueue_script( 'circletype', ADVKT_THEME_JS_DIR.'circletype.min.js', array('jquery'), false, true );
wp_enqueue_script( 'simpleParallax', ADVKT_THEME_JS_DIR.'simpleParallax.min.js', array('jquery'), false, true );
wp_enqueue_script( 'advkt-plugins', ADVKT_THEME_JS_DIR.'plugins.js', array('jquery'), false, true );
wp_enqueue_script( 'advkt-main', ADVKT_THEME_JS_DIR.'custom.js', array('jquery'), '1.0.1', true );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'wp_enqueue_scripts', 'advkt_scripts' );
/*
Register Fonts
*/
function advkt_fonts_url() {
$font_url = '';
/*
Translators: If there are characters in your language that are not supported
by chosen font(s), translate this to 'off'. Do not translate into your own language.
*/
if ( 'off' !== _x( 'on', 'Google font: on or off', 'advkt' ) ) {
$font_url = add_query_arg( 'family', urlencode( 'Hepta Slab:400,500,600,700|Jost:400,500,600,700' ), "//fonts.googleapis.com/css" );
}
return $font_url;
}
/**
* Implement the Custom Header feature.
*/
require get_template_directory() . '/inc/custom-header.php';
/**
* Functions which enhance the theme by hooking into WordPress.
*/
require get_template_directory() . '/inc/template-functions.php';
/**
* Custom template helper function for this theme.
*/
require get_template_directory() . '/inc/template-helper.php';
/**
* Load Jetpack compatibility file.
*/
if ( defined( 'JETPACK__VERSION' ) ) {
require get_template_directory() . '/inc/jetpack.php';
}
/**
* include advkt functions file
*/
require_once ADVKT_THEME_INC . 'advkt_navwalker.php';
require_once ADVKT_THEME_INC . 'advkt_customizer.php';
require_once ADVKT_THEME_INC . 'advkt_customizer_data.php';
require_once ADVKT_THEME_INC . 'class-tgm-plugin-activation.php';
require_once ADVKT_THEME_INC . 'advkt_add_plugin.php';
/**
* Add a pingback url auto-discovery header for single posts, pages, or attachments.
*/
function advkt_pingback_header() {
if ( is_singular() && pings_open() ) {
printf( '', esc_url( get_bloginfo( 'pingback_url' ) ) );
}
}
add_action( 'wp_head', 'advkt_pingback_header' );
/**
*
* comment section
*
*/
add_filter('comment_form_default_fields', 'advkt_comment_form_default_fields_func');
function advkt_comment_form_default_fields_func($default){
$default['author'] = '
';
$default['email'] = '
';
$default['url'] = '';
$default['clients_commnet'] = '
';
return $default;
}
add_filter('comment_form_defaults', 'advkt_comment_form_defaults_func');
function advkt_comment_form_defaults_func($info){
if( !is_user_logged_in() ){
$info['comment_field'] = '';
$info['submit_field'] = '%1$s %2$s
';
}else {
$info['comment_field'] = '';
}
$info['submit_button'] = '';
$info['title_reply_before'] = '';
$info['comment_notes_before'] = '';
return $info;
}
if( !function_exists('advkt_comment') ) {
function advkt_comment($comment, $args, $depth) {
$GLOBAL['comment'] = $comment;
extract($args, EXTR_SKIP);
$args['reply_text'] = ' Reply';
$replayClass = 'comment-depth-' . esc_attr($depth);
?>
'; $info['title_reply_after'] = '