240, 'width' => 240, 'flex-height' => true, ) ); add_theme_support( 'custom-background', array( 'default-color' => 'f1f1f1' ) ); /* * This theme styles the visual editor to resemble the theme style, * specifically font, colors, icons, and column width. */ add_editor_style( array( 'css/editor-style.css', vw_lawyer_attorney_font_url() ) ); // Theme Activation Notice global $pagenow; if (is_admin() && ('themes.php' == $pagenow) && isset( $_GET['activated'] )) { add_action('admin_notices', 'law_advocate_activation_notice'); } } endif; add_action( 'after_setup_theme', 'law_advocate_setup' ); // Notice after Theme Activation function law_advocate_activation_notice() { echo '
'; echo '

'. esc_html__( 'Thank you for choosing Law Advocate Theme. Would like to have you on our Welcome page so that you can reap all the benefits of our Law Advocate Theme.', 'law-advocate' ) .'

'; echo ''. esc_html__( 'GET STARTED', 'law-advocate' ) .''; echo ''. esc_html__( 'VIEW DEMO', 'law-advocate' ) .''; echo ''. esc_html__( 'UPGRADE PRO', 'law-advocate' ) .''; echo '
'; } add_action( 'wp_enqueue_scripts', 'law_advocate_enqueue_styles' ); function law_advocate_enqueue_styles() { $parent_style = 'vw-lawyer-attorney-basic-style'; // Style handle of parent theme. wp_enqueue_style( 'bootstrap-style', esc_url(get_template_directory_uri()).'/css/bootstrap.css' ); wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' ); wp_enqueue_style( 'law-advocate-style', get_stylesheet_uri(), array( $parent_style ) ); require get_theme_file_path( '/inline-style.php' ); wp_add_inline_style( 'law-advocate-style',$vw_lawyer_attorney_custom_css ); require get_parent_theme_file_path( '/inline-style.php' ); wp_add_inline_style( 'vw-lawyer-attorney-basic-style',$vw_lawyer_attorney_custom_css ); wp_enqueue_style( 'law-advocate-block-style', get_theme_file_uri('/assets/css/blocks.css') ); wp_enqueue_style( 'law-advocate-block-patterns-style-frontend', get_theme_file_uri('/inc/block-patterns/css/block-frontend.css') ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'init', 'law_advocate_remove_parent_function'); function law_advocate_remove_parent_function() { remove_action( 'admin_notices', 'vw_lawyer_attorney_activation_notice' ); remove_action( 'admin_menu', 'vw_lawyer_attorney_gettingstarted' ); } add_action( 'customize_register', 'law_advocate_customize_register', 11 ); function law_advocate_customize_register($wp_customize) { global $wp_customize; $wp_customize->remove_section( 'vw_lawyer_attorney_upgrade_pro_link' ); $wp_customize->remove_section( 'vw_lawyer_attorney_get_started_link' ); $wp_customize->remove_section( 'vw_lawyer_attorney_social_icon_settings' ); $wp_customize->remove_section( 'vw_lawyer_attorney_amenities_section' ); $wp_customize->remove_control( 'vw_lawyer_attorney_topbar_padding_top_bottom' ); $wp_customize->remove_control( 'vw_lawyer_attorney_search_border_radius' ); $wp_customize->remove_control( 'vw_lawyer_attorney_sticky_header' ); $wp_customize->remove_control( 'vw_lawyer_attorney_sticky_header_padding' ); $wp_customize->remove_control( 'vw_lawyer_attorney_location1' ); $wp_customize->remove_control( 'vw_lawyer_attorney_time1' ); $wp_customize->remove_control( 'vw_lawyer_attorney_time' ); $wp_customize->remove_control( 'vw_lawyer_attorney_stickyheader_hide_show' ); $wp_customize->remove_control( 'vw_lawyer_attorney_search_padding_top_bottom' ); $wp_customize->remove_control( 'vw_lawyer_attorney_search_padding_left_right' ); //Header $wp_customize->add_setting('law_advocate_header_contact_btn_text',array( 'default'=> '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('law_advocate_header_contact_btn_text',array( 'label' => esc_html__('Add Button Text','law-advocate'), 'input_attrs' => array( 'placeholder' => esc_html__( 'Contact Us', 'law-advocate' ), ), 'section'=> 'vw_lawyer_attorney_contact', 'type'=> 'text' )); $wp_customize->add_setting('law_advocate_header_contact_btn_link',array( 'default'=> '', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control('law_advocate_header_contact_btn_link',array( 'label' => esc_html__('Add Button Link','law-advocate'), 'input_attrs' => array( 'placeholder' => esc_html__( 'www.example.com', 'law-advocate' ), ), 'section'=> 'vw_lawyer_attorney_contact', 'type'=> 'url' )); //About Section $wp_customize->add_setting('law_advocate_section_small_title',array( 'default'=> '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('law_advocate_section_small_title',array( 'label' => esc_html__('Section Small Title','law-advocate'), 'input_attrs' => array( 'placeholder' => esc_html__( 'ABOUT LAW', 'law-advocate' ), ), 'section'=> 'vw_lawyer_attorney_about1', 'type'=> 'text' )); $wp_customize->add_setting('law_advocate_about_image2',array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control( new WP_Customize_Image_Control($wp_customize,'law_advocate_about_image2',array( 'label' => __('Client Image','law-advocate'), 'section' => 'vw_lawyer_attorney_about1' ))); $wp_customize->add_setting('law_advocate_about_client_name',array( 'default'=> '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('law_advocate_about_client_name',array( 'label' => esc_html__('Client Name','law-advocate'), 'section'=> 'vw_lawyer_attorney_about1', 'type'=> 'text' )); $wp_customize->add_setting('law_advocate_about_client_designation',array( 'default'=> '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('law_advocate_about_client_designation',array( 'label' => esc_html__('Client Designation','law-advocate'), 'section'=> 'vw_lawyer_attorney_about1', 'type'=> 'text' )); for ( $i=1; $i <= 4 ; $i++ ) { $wp_customize->add_setting('law_advocate_about_list_icon' .$i,array( 'default' => 'fas fa-check', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control(new VW_Lawyer_Attorney_Fontawesome_Icon_Chooser( $wp_customize,'law_advocate_about_list_icon' .$i, array( 'label' => __('Add About List Icon','law-advocate'), 'transport' => 'refresh', 'section' => 'vw_lawyer_attorney_about1', 'type' => 'icon' ))); $wp_customize->add_setting( 'law_advocate_about_page_list' . $i, array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control( 'law_advocate_about_page_list' . $i, array( 'label' => __( 'Add About List Text', 'law-advocate' ), 'section' => 'vw_lawyer_attorney_about1', 'type' => 'text' )); } } define('LAW_ADVOCATE_FREE_THEME_DOC',__('https://www.vwthemesdemo.com/docs/free-vw-law-advocate/','law-advocate')); define('LAW_ADVOCATE_SUPPORT',__('https://wordpress.org/support/theme/law-advocate/','law-advocate')); define('LAW_ADVOCATE_REVIEW',__('https://wordpress.org/support/theme/law-advocate/reviews','law-advocate')); define('LAW_ADVOCATE_BUY_NOW',__('https://www.vwthemes.com/themes/advocate-wordpress-theme/','law-advocate')); define('LAW_ADVOCATE_LIVE_DEMO',__('https://www.vwthemes.net/law-advocate/','law-advocate')); define('LAW_ADVOCATE_PRO_DOC',__('https://www.vwthemesdemo.com/docs/law-advocate-pro/','law-advocate')); define('LAW_ADVOCATE_FAQ',__('https://www.vwthemes.com/faqs/','law-advocate')); define('LAW_ADVOCATE_CONTACT',__('https://www.vwthemes.com/contact/','law-advocate')); define('LAW_ADVOCATE_CHILD_THEME',__('https://developer.wordpress.org/themes/advanced-topics/child-themes/','law-advocate')); define('LAW_ADVOCATE_CREDIT',__('https://www.vwthemes.com/themes/free-law-wordpress-theme/','law-advocate')); if ( ! function_exists( 'law_advocate_credit' ) ) { function law_advocate_credit(){ echo "". esc_html__('Lawyer WordPress Theme','law-advocate') .""; } } /** * Enqueue block editor style */ function law_advocate_block_editor_styles() { wp_enqueue_style( 'law-advocate-font', vw_lawyer_attorney_font_url(), array() ); wp_enqueue_style( 'law-advocate-block-patterns-style-editor', get_theme_file_uri( '/inc/block-patterns/css/block-editor.css' ), false, '1.0', 'all' ); } add_action( 'enqueue_block_editor_assets', 'law_advocate_block_editor_styles' ); function law_advocate_sanitize_choices( $input, $setting ) { global $wp_customize; $control = $wp_customize->get_control( $setting->id ); if ( array_key_exists( $input, $control->choices ) ) { return $input; } else { return $setting->default; } } function law_advocate_sanitize_dropdown_pages( $page_id, $setting ) { $page_id = absint( $page_id ); return ( 'publish' == get_post_status( $page_id ) ? $page_id : $setting->default ); } /* Theme Widgets Setup */ function law_advocate_widgets_init() { register_sidebar( array( 'name' => __( 'Footer Navigation 1', 'law-advocate' ), 'description' => __( 'Appears on footer 1', 'law-advocate' ), 'id' => 'footer-1', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer Navigation 2', 'law-advocate' ), 'description' => __( 'Appears on footer 2', 'law-advocate' ), 'id' => 'footer-2', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer Navigation 3', 'law-advocate' ), 'description' => __( 'Appears on footer 3', 'law-advocate' ), 'id' => 'footer-3', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer Navigation 4', 'law-advocate' ), 'description' => __( 'Appears on footer 4', 'law-advocate' ), 'id' => 'footer-4', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Social Media', 'law-advocate' ), 'description' => __( 'Appears on Topbar section', 'law-advocate' ), 'id' => 'social-links', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'law_advocate_widgets_init' ); // Customizer Pro load_template( ABSPATH . WPINC . '/class-wp-customize-section.php' ); class Law_Advocate_Customize_Section_Pro extends WP_Customize_Section { public $type = 'law-advocate'; public $pro_text = ''; public $pro_url = ''; public function json() { $json = parent::json(); $json['pro_text'] = $this->pro_text; $json['pro_url'] = esc_url( $this->pro_url ); return $json; } protected function render_template() { ?>
  • {{ data.title }} <# if ( data.pro_text && data.pro_url ) { #> {{ data.pro_text }} <# } #>

  • setup_actions(); } return $instance; } private function __construct() {} private function setup_actions() { // Register panels, sections, settings, controls, and partials. add_action( 'customize_register', array( $this, 'sections' ) ); // Register scripts and styles for the controls. add_action( 'customize_controls_enqueue_scripts', array( $this, 'enqueue_control_scripts' ), 0 ); } public function sections( $manager ) { // Register custom section types. $manager->register_section_type( 'Law_Advocate_Customize_Section_Pro' ); // Register sections. $manager->add_section( new Law_Advocate_Customize_Section_Pro( $manager, 'law_advocate_upgrade_pro_link', array( 'priority' => 1, 'title' => esc_html__( 'Law Advocate PRO', 'law-advocate' ), 'pro_text' => esc_html__( 'UPGRADE PRO', 'law-advocate' ), 'pro_url' => esc_url('https://www.vwthemes.com/themes/advocate-wordpress-theme/'), ) ) ); // Register sections. $manager->add_section(new Law_Advocate_Customize_Section_Pro($manager,'law_advocate_get_started_link',array( 'priority' => 1, 'title' => esc_html__( 'DOCUMENTATION', 'law-advocate' ), 'pro_text' => esc_html__( 'DOCS', 'law-advocate' ), 'pro_url' => admin_url('themes.php?page=law_advocate_guide'), ))); } public function enqueue_control_scripts() { wp_enqueue_script( 'law-advocate-customize-controls', get_stylesheet_directory_uri() . '/assets/js/customize-controls-child.js', array( 'customize-controls' ) ); wp_enqueue_style( 'law-advocate-customize-controls', get_stylesheet_directory_uri() . '/assets/css/customize-controls-child.css' ); } } Law_Advocate_Customize::get_instance(); /* getstart */ require get_theme_file_path('/inc/getstart/getstart.php'); /* Plugin Activation */ require get_theme_file_path() . '/inc/getstart/plugin-activation.php'; /* Block Pattern */ require get_theme_file_path('/inc/block-patterns/block-patterns.php');