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' ) ); add_action( 'wp_enqueue_scripts', array( $this, 'enqueuePriorityScripts' ), 1 ); } function enqueuePriorityScripts() { wp_register_style('font-awesome', ATTIRE_TEMPLATE_URL . '/fonts/fontawesome/css/all.min.css'); wp_enqueue_style('font-awesome'); } /** * @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 ); wp_enqueue_script( 'jquery' ); //attire-mbl-menu //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/fontawesome/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_register_style( 'attire-woocommerce', ATTIRE_TEMPLATE_URL . '/css/woocommerce.css' ); if ( class_exists( 'WooCommerce' ) ) wp_enqueue_style( 'attire-woocommerce' ); wp_register_style( 'attire', ATTIRE_TEMPLATE_URL . '/css/attire.css' ); wp_enqueue_style( 'attire' ); 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-site', ATTIRE_TEMPLATE_URL . '/js/site.js', array( 'jquery' ), 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: ', '' ); ?>
%s %s
', sprintf( '', __( 'Email' ), ( $req ? ' *' : '' ) ), sprintf( '', ( $html5 ? 'type="email"' : 'type="text"' ), esc_attr( $commenter['comment_author_email'] ), $html_req ) ), 'url' => sprintf( '%s %s
', sprintf( '', __( 'Website' ) ), sprintf( '', ( $html5 ? 'type="url"' : 'type="text"' ), esc_attr( $commenter['comment_author_url'] ) ) ), ); if ( has_action( 'set_comment_cookies', 'wp_set_comment_cookies' ) && get_option( 'show_comments_cookies_opt_in' ) ) { $consent = empty( $commenter['comment_author_email'] ) ? '' : ' checked="checked"'; $fields['cookies'] = sprintf( '', sprintf( '', $consent ), sprintf( '', __( 'Save my name, email, and website in this browser for the next time I comment.' ) ) ); // Ensure that the passed fields include cookies consent. if ( isset( $args['fields'] ) && ! isset( $args['fields']['cookies'] ) ) { $args['fields']['cookies'] = $fields['cookies']; } } $required_text = sprintf( /* translators: %s: Asterisk symbol (*). */ ' ' . __( 'Required fields are marked %s' ), '*' ); /** * Filters the default comment form fields. * * @since 3.0.0 * * @param string[] $fields Array of the default comment fields. */ $fields = apply_filters( 'comment_form_default_fields', $fields ); $defaults = array( 'fields' => $fields, 'comment_field' => sprintf( '%s %s
', sprintf( '', _x( 'Comment', 'noun' ) ), '' ), 'must_log_in' => sprintf( '%s
', sprintf( /* translators: %s: Login URL. */ __( 'You must be logged in to post a comment.' ), /** This filter is documented in wp-includes/link-template.php */ wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ), $post_id ) ) ) ), 'logged_in_as' => sprintf( '%s
', sprintf( /* translators: 1: Edit user link, 2: Accessibility text, 3: User name, 4: Logout URL. */ __( 'Logged in as %3$s. Log out?' ), get_edit_user_link(), /* translators: %s: User name. */ esc_attr( sprintf( __( 'Logged in as %s. Edit your profile.' ), $user_identity ) ), $user_identity, /** This filter is documented in wp-includes/link-template.php */ wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ), $post_id ) ) ) ), 'comment_notes_before' => sprintf( '%s%s
', sprintf( '%s', __( 'Your email address will not be published.' ) ), ( $req ? $required_text : '' ) ), 'comment_notes_after' => '', 'action' => site_url( '/wp-comments-post.php' ), 'id_form' => 'commentform', 'id_submit' => 'submit', 'class_form' => 'comment-form', 'class_submit' => 'btn btn-primary btn-lg', 'name_submit' => 'submit', 'title_reply' => __( 'Leave a Reply' ), /* translators: %s: Author of the comment being replied to. */ 'title_reply_to' => __( 'Leave a Reply to %s' ), 'title_reply_before' => '