RegisterNavMenus(); $this->Filters(); $this->Actions(); add_action( 'after_setup_theme', array( $this, 'ThemeSetup' ) ); } /** * Usage: Load language file */ function LoadTextDoamin() { load_theme_textdomain( 'attire', get_template_directory() . '/languages' ); } function Filters() { } function Actions() { add_action( 'wp_enqueue_scripts', array( $this, 'enqueueScripts' ) ); } /** * @usage Load all necessary scripts & styles */ function enqueueScripts() { $theme_mod = get_option( 'attire_options' ); // Font Options ( From Customizer Typography Options ) $family[] = sanitize_text_field( $theme_mod['heading_font'] ); $family[] = sanitize_text_field( $theme_mod['body_font'] ); $family[] = sanitize_text_field( $theme_mod['widget_title_font'] ); $family[] = sanitize_text_field( $theme_mod['widget_content_font'] ); $family[] = sanitize_text_field( $theme_mod['menu_top_font'] ); $family[] = sanitize_text_field( $theme_mod['menu_dropdown_font'] ); $family = array_unique( $family ); // echo '
'.json_encode($theme_mod,JSON_PRETTY_PRINT).''; $cssimport = '//fonts.googleapis.com/css?family=' . implode( "|", $family ); $cssimport = str_replace( '||', '|', $cssimport ); //attire-mbl-menu wp_register_style( 'attire-gn-comp', ATTIRE_TEMPLATE_URL . '/mobile-menu-rss/css/component.css' ); wp_enqueue_style( 'attire-gn-comp' ); wp_register_script( 'attire-gn-modernizr', ATTIRE_TEMPLATE_URL . '/mobile-menu-rss/js/modernizr.custom.js', array(), null, false ); wp_enqueue_script( 'attire-gn-modernizr' ); wp_register_script( 'attire-gn-classie', ATTIRE_TEMPLATE_URL . '/mobile-menu-rss/js/classie.js', array(), null, true ); wp_enqueue_script( 'attire-gn-classie' ); wp_register_script( 'attire-gn-gnm', ATTIRE_TEMPLATE_URL . '/mobile-menu-rss/js/gnmenu.js', array(), null, true ); wp_enqueue_script( 'attire-gn-gnm' ); wp_register_script( 'attire-sticky', ATTIRE_TEMPLATE_URL . '/js/jquery.sticky.js', array('jquery'), null, true ); wp_enqueue_script( 'attire-sticky' ); wp_register_style( 'attire-responsive', ATTIRE_TEMPLATE_URL . '/css/responsive.css' ); wp_enqueue_style( 'attire-responsive' ); wp_register_style( 'bootstrap', ATTIRE_TEMPLATE_URL . '/bootstrap/css/bootstrap.min.css' ); wp_enqueue_style( 'bootstrap' ); wp_register_style( 'attire-main', get_stylesheet_uri(), array( 'bootstrap', 'attire-responsive' ) ); wp_enqueue_style( 'attire-main' ); wp_register_style( 'font-awesome', ATTIRE_TEMPLATE_URL . '/fonts/font-awesome/css/all.min.css' ); wp_enqueue_style( 'font-awesome' ); wp_register_style( 'attire-google-fonts', $cssimport, array(), null ); wp_enqueue_style( 'attire-google-fonts' ); wp_enqueue_script( 'attire-html5', get_template_directory_uri() . '/js/html5shiv.js', array(), null ); wp_script_add_data( 'attire-html5', 'conditional', 'lt IE 9' ); wp_enqueue_script( 'attire-respond', get_template_directory_uri() . '/js/respond.min.js', array(), null ); wp_script_add_data( 'attire-respond', 'conditional', 'lt IE 9' ); wp_register_script( 'popper', ATTIRE_TEMPLATE_URL . '/bootstrap/js/popper.min.js', array(), null, true ); wp_enqueue_script( 'popper' ); wp_register_script( 'bootstrap', ATTIRE_TEMPLATE_URL . '/bootstrap/js/bootstrap.min.js', array( 'jquery', 'popper' ), null, true ); wp_enqueue_script( 'bootstrap' ); wp_register_script( 'attire-modernizer', ATTIRE_TEMPLATE_URL . '/js/modernizr-custom.js', array(), null, true ); wp_enqueue_script( 'attire-modernizer' ); wp_register_script( 'attire-site', ATTIRE_TEMPLATE_URL . '/js/site.js', array( 'jquery', 'attire-gn-gnm' ), null, true ); wp_enqueue_script( 'attire-site' ); wp_register_script( 'comment-reply', '', array(), null, true ); wp_enqueue_script( 'comment-reply' ); wp_localize_script( 'attire-site', 'sitejs_local_obj', array( 'home_url' => esc_url( home_url( '/' ) ) ) ); } function sanitize_hex_color_front( $color ) { if ( '' === $color ) { return ''; } // 3 or 6 hex digits, or the empty string. if ( preg_match( '|^#([A-Fa-f0-9]{3}){1,2}$|', $color ) ) { return $color; } } /** * @usage: Register nav menus */ function RegisterNavMenus() { register_nav_menus( array( 'primary' => __( 'Top Menu', 'attire' ) ) ); register_nav_menus( array( 'footer_menu' => __( 'Footer Menu', 'attire' ) ) ); } /** * @usage Post Comments * * @param $comment * @param $args * @param $depth */ public static function Comment( $comment, $args, $depth ) { switch ( $comment->comment_type ) : case 'pingback' : case 'trackback' : ?>
Pingback: ', '' ); ?>