npm install -g browser-syncbrowser-sync start --server --directory --files "**/*"| function gl_loginout_menu_link( $items, $args ) { | |
| if ($args->theme_location == 'primary') { | |
| if (is_user_logged_in()) { | |
| $items .= '<li class="right"><a href="'. wp_logout_url() .'">'. __("Log Out") .'</a></li>'; | |
| } else { | |
| $items .= '<li class="right"><a href="'. wp_login_url(get_permalink()) .'">'. __("Log In") .'</a></li>'; | |
| } | |
| } | |
| return $items; |
| RewriteEngine On | |
| RewriteCond %{HTTP_HOST} ^asique.me$ [OR] | |
| RewriteCond %{HTTP_HOST} ^www.asique.me$ | |
| RewriteRule ^(.*)$ https://asique.net/$1 [R=301,L] | |
| ##Redirect Type | |
| ##301 Permanent Redirect | |
| ##307 Temporary Redirect |
| /* | |
| * Add CSS Class to Last Menu Item Anchor Tag | |
| */ | |
| function add_specific_menu_atts( $atts, $item, $args ) { | |
| if ( $args->menu->count == $item->menu_order && $args->theme_location == 'primary' ) { | |
| $atts[ 'class' ] = 'btn-def'; | |
| } | |
| return $atts; | |
| } |
| <?php | |
| /* | |
| * Disable Redux Developer Mode dev_mode | |
| */ | |
| function redux_disable_dev_mode_plugin( $redux ) { | |
| if ( ! function_exists( 'redux_disable_dev_mode_plugin' ) ) { | |
| if ( $redux->args['opt_name'] != 'redux_demo' ) { | |
| $redux->args['dev_mode'] = false; | |
| $redux->args['forced_dev_mode_off'] = false; |
| ##Create new file named “.htaccess” in the folder with this Content | |
| AuthName "Password Protected!" | |
| AuthType Basic | |
| AuthUserFile /home/cpanel_user_name/public_html/folder_name/.htpasswd | |
| require valid-user | |
| ##Create new file named “.htpasswd” in the same folder with this Content (Username:Password) | |
| asiq:12345 |
| /* | |
| * Add "odd" "even" Class Name to "post_class" | |
| */ | |
| function odd_even_post_class( $classes ) { | |
| global $oddeven_class; | |
| $oddeven_class = ( $oddeven_class == 'odd' ) ? 'even' : 'odd'; | |
| $classes[] = $oddeven_class; |
| /* | |
| * Change Upload Directory for Specific Files Type | |
| * Only works in WordPress 3.3+ | |
| */ | |
| function wpse47415_pre_upload( $file ) { | |
| add_filter( 'upload_dir', 'wpse47415_custom_upload_dir' ); | |
| return $file; | |
| } |
| /* | |
| * Limit Category to 1 Category in Edit Screen. | |
| */ | |
| function limit_cat_to_one() { | |
| if ( is_admin() ) { | |
| ?> | |
| <script> | |
| jQuery( document ).ready( function ( $ ) { | |
| $( "#category-all input:checkbox" ).change( function () { |
| /* | |
| * Remove WordPress Dashboard Widget | |
| */ | |
| function remove_dashboard_widgets() { | |
| remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' ); //Quick Press widget | |
| remove_meta_box( 'dashboard_recent_drafts', 'dashboard', 'side' ); //Recent Drafts | |
| remove_meta_box( 'dashboard_primary', 'dashboard', 'side' ); //WordPress.com Blog | |
| remove_meta_box( 'dashboard_secondary', 'dashboard', 'side' ); //Other WordPress News | |
| remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' ); //Incoming Links | |
| remove_meta_box( 'dashboard_plugins', 'dashboard', 'normal' ); //Plugins |