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' => '

', 'after_title' => '

', ) ); /** * Footer Top Widget */ register_sidebar( array( 'name' => esc_html__( 'Footer Top Widget', 'advkt' ), 'id' => 'footer-top-widget', 'description' => esc_html__( 'Footer Top Widget by Advkt', 'advkt' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); /** * Footer Widget Style 1 er 1st Widget */ register_sidebar( array( 'name' => esc_html__( 'Footer Widget Style 1 : Address', 'advkt' ), 'id' => 'footer-address-widget', 'description' => esc_html__( '1st Widget of Footer Widget Style 1', 'advkt' ), 'before_widget' => '', 'before_title' => '', ) ); /** * Footer Widget Style 1 er 1st Widget */ register_sidebar( array( 'name' => esc_html__( 'Footer Widget Style 1 : Offices Link', 'advkt' ), 'id' => 'footer-offices-link-widget', 'description' => esc_html__( '1st Widget of Footer Widget Style 1', 'advkt' ), 'before_widget' => '', 'before_title' => '', ) ); /** * Footer Widget Style 1 er 3rd Widget */ register_sidebar( array( 'name' => esc_html__( 'Footer Widget Style 1 : Expertises Link', 'advkt' ), 'id' => 'footer-expertise-links-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 : Services Link', 'advkt' ), 'id' => 'footer-service-links-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 : Links', '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 : Address', '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 : Instagram', 'advkt' ), 'id' => 'fws-2-er-fourth-widget', 'description' => esc_html__( '4th Widget of Footer Widget Style 2', 'advkt' ), 'before_widget' => '', 'before_title' => '', ) ); /** * service Widget */ register_sidebar( array( 'name' => esc_html__( 'Single Service Page Widgets', 'advkt' ), 'id' => 'advkt-service-widget', 'description' => esc_html__( 'Service Single Page Widgets Here', 'advkt' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '', 'after_title' => '', ) ); /** * Project Widget */ register_sidebar( array( 'name' => esc_html__( 'Single Project Page Widgets', 'advkt' ), 'id' => 'advkt-project-widget', 'description' => esc_html__( 'Project Single Page Widgets Here', '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'), time(), true ); wp_enqueue_script( 'custom-slider', ADVKT_THEME_JS_DIR.'custom-slider.js', array('jquery'), false, 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_field'] = '%1$s %2$s
'; } $info['submit_button'] = ''; $info['title_reply_before'] = '

'; $info['title_reply_after'] = '

'; $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); ?>
  • >
    array())); ?>
    $depth, 'max_depth' => $args['max_depth'] ))); ?>
    [' => '[', ']

    ' => ']', ']
    ' => ']' ); return strtr( $content, $array ); } /** * [ocdi_import_files description] * @return [type] [description] */ function advkt_import_files() { return array( array( 'import_file_name' => esc_html__('Advkt Demo Data', 'advkt'), 'import_file_url' => 'https://wpdemo.alexisnickcreates.com/demo/advkt-content.xml', 'import_widget_file_url' => 'https://wpdemo.alexisnickcreates.com/demo/advkt-widgets.wie', 'import_preview_image_url' => 'https://advkt.alexisnickcreates.com/demo/advkt/screenshot.png', 'local_import_redux' => array( array( 'file_path' => get_template_directory() . '/inc/advkt_customizer_redux_options.json', 'option_name' => 'advkt_options', ), ), 'import_notice' => esc_html__( 'After you import this demo, you will have to setup the Instagram Widget For WP separately.', 'advkt' ), ), ); } add_filter( 'pt-ocdi/import_files', 'advkt_import_files' ); /** * [ocdi_after_import_setup description] * @return [type] [description] */ function ocdi_after_import_setup() { // Assign menus to their locations. $main_menu = get_term_by( 'name', 'Main Menu', 'nav_menu' ); $footer_menu = get_term_by( 'name', 'Footer Menu', 'nav_menu' ); set_theme_mod( 'nav_menu_locations', array( 'main-menu' => $main_menu->term_id, 'footer-menu' => $footer_menu->term_id, ) ); // Assign front page and posts page (blog page). $front_page_id = get_page_by_title( 'Home' ); $blog_page_id = get_page_by_title( 'Blog' ); update_option( 'show_on_front', 'page' ); update_option( 'page_on_front', $front_page_id->ID ); update_option( 'page_for_posts', $blog_page_id->ID ); // Update elementor page settings $args = array( 'post_type' => 'elementor_library', ); $elementor_library = get_posts( $args ); $elementor_page_settings = 'a:12:{s:13:"system_colors";a:4:{i:0;a:3:{s:3:"_id";s:7:"primary";s:5:"title";s:7:"Primary";s:5:"color";s:7:"#6EC1E4";}i:1;a:3:{s:3:"_id";s:9:"secondary";s:5:"title";s:9:"Secondary";s:5:"color";s:7:"#54595F";}i:2;a:3:{s:3:"_id";s:4:"text";s:5:"title";s:4:"Text";s:5:"color";s:7:"#7A7A7A";}i:3;a:3:{s:3:"_id";s:6:"accent";s:5:"title";s:6:"Accent";s:5:"color";s:7:"#61CE70";}}s:13:"custom_colors";a:0:{}s:17:"system_typography";a:4:{i:0;a:5:{s:3:"_id";s:7:"primary";s:5:"title";s:7:"Primary";s:21:"typography_typography";s:6:"custom";s:22:"typography_font_family";s:6:"Roboto";s:22:"typography_font_weight";s:3:"600";}i:1;a:5:{s:3:"_id";s:9:"secondary";s:5:"title";s:9:"Secondary";s:21:"typography_typography";s:6:"custom";s:22:"typography_font_family";s:11:"Roboto Slab";s:22:"typography_font_weight";s:3:"400";}i:2;a:5:{s:3:"_id";s:4:"text";s:5:"title";s:4:"Text";s:21:"typography_typography";s:6:"custom";s:22:"typography_font_family";s:6:"Roboto";s:22:"typography_font_weight";s:3:"400";}i:3;a:5:{s:3:"_id";s:6:"accent";s:5:"title";s:6:"Accent";s:21:"typography_typography";s:6:"custom";s:22:"typography_font_family";s:6:"Roboto";s:22:"typography_font_weight";s:3:"500";}}s:17:"custom_typography";a:0:{}s:21:"default_generic_fonts";s:10:"Sans-serif";s:9:"site_name";s:5:"Advkt";s:16:"site_description";s:46:"Lawyer Attorney & Law Firm WordPress Theme";s:15:"container_width";a:3:{s:4:"unit";s:2:"px";s:4:"size";i:1323;s:5:"sizes";a:0:{}}s:21:"space_between_widgets";a:5:{s:6:"column";s:1:"0";s:3:"row";s:1:"0";s:8:"isLinked";b:0;s:4:"unit";s:2:"px";s:4:"size";i:0;}s:19:"page_title_selector";s:14:"h1.entry-title";s:11:"viewport_md";i:768;s:11:"viewport_lg";i:1025;}'; foreach($elementor_library as $single_library) { if($single_library->post_name === 'default-kit') { update_post_meta( $single_library->ID, '_elementor_page_settings', unserialize($elementor_page_settings)); } } // Set the new value for posts_per_page $new_posts_per_page = 4; // Update post types $custom_post_types = array( 'post', 'page', 'e-landing-page', 'advkt-service', 'advkt-portfolio', 'advkt-member', ); // Update the posts_per_page option update_option('posts_per_page', $new_posts_per_page); update_option('elementor_cpt_support', $custom_post_types); update_option("permalink_structure", "/%postname%/"); update_option('elementor_experiment-container', 'inactive'); update_option('elementor_experiment-container_grid', 'inactive'); } add_action( 'pt-ocdi/after_import', 'ocdi_after_import_setup' ); // advkt_search_filter_form if(!function_exists('advkt_search_filter_form')){ function advkt_search_filter_form( $form ) { $form = sprintf( '', esc_url( home_url('/')), esc_attr( get_search_query()), esc_html__('Search','advkt') ); return $form; } add_filter( 'get_search_form','advkt_search_filter_form'); } function _html_markup_render( $markup ){ return $markup; } add_action('admin_enqueue_scripts', 'advkt_admin_custom_scripts'); function advkt_admin_custom_scripts(){ wp_enqueue_media(); wp_register_script('advkt-admin-custom', get_template_directory_uri().'/inc/js/admin_custom.js', array('jquery'), '', true); wp_enqueue_script('advkt-admin-custom'); } // Hook into the One Click Demo Import before content import add_action('pt-ocdi/before_content_import', 'conditionally_reset_before_demo_import'); function conditionally_reset_before_demo_import() { // Call the functions to reset posts, pages, and widgets reset_all_posts(); reset_all_pages(); reset_all_widgets(); } function reset_all_posts() { // Get all posts $all_posts = get_posts(array( 'numberposts' => -1, 'post_type' => 'post', 'post_status' => 'any' )); // Delete each post foreach ($all_posts as $post) { wp_delete_post($post->ID, true); } } function reset_all_pages() { // Get all pages $all_pages = get_posts(array( 'numberposts' => -1, 'post_type' => 'page', 'post_status' => 'any' )); // Delete each page foreach ($all_pages as $page) { wp_delete_post($page->ID, true); } } function reset_all_widgets() { global $wpdb; // Delete all widgets $wpdb->query("DELETE FROM {$wpdb->options} WHERE option_name LIKE 'widget_%'"); // Optionally reset widget sidebars too delete_option('sidebars_widgets'); // Optionally reset customizer settings related to widgets delete_option('theme_mods_' . get_option('stylesheet')); // Clear the widgets cache wp_cache_delete('alloptions', 'options'); }