This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jQuery.fn.backtotop = function( options ) { | |
| // This is the easiest way to have default options. | |
| var settings = jQuery.extend({ | |
| color: "white", | |
| backgroundColor: "rgba(200,200,200,0.75)", | |
| visibleAfter: "100px", | |
| left : "15px", | |
| right: "", | |
| marginLeft : "0px", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Disable Default Dashboard Widgets | |
| @ https://digwp.com/2014/02/disable-default-dashboard-widgets/ | |
| */ | |
| function disable_default_dashboard_widgets() { | |
| global $wp_meta_boxes; | |
| // wp.. | |
| unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_activity']); | |
| unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']); | |
| unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']); | |
| unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Run This Script beforehand | |
| * npm install --save-dev gulp gulp-clean gulp-ruby-sass gulp-concat gulp-minify-css gulp-uglify gulp-babel run-sequence | |
| */ | |
| var gulp = require('gulp'); | |
| var clean = require('gulp-clean'); | |
| var sass = require('gulp-ruby-sass'); | |
| var concat = require('gulp-concat'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Credits to http://stackoverflow.com/questions/2380019/generate-8-unique-random-numbers-between-1-and-100 | |
| function generate_unique_random( set_length, max_range ){ | |
| var arr = [] | |
| while(arr.length < set_length){ | |
| var randomnumber=Math.ceil( Math.random() * max_range ) | |
| var found=false; | |
| for(var i=0;i<arr.length;i++){ | |
| if(arr[i]==randomnumber){found=true;break} | |
| } | |
| if(!found)arr[arr.length]=randomnumber; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jQuery(document).ready(function($){ | |
| function centerme( parent, child ){ | |
| var child_margin_top = ( $(parent).innerHeight()-$(child).innerHeight() )/2; | |
| if( child_margin_top < 0 ) return; | |
| $(child).css( 'margin-top', child_margin_top+'px' ); | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // functions.php | |
| // ========================================================================= | |
| // REMOVE JUNK FROM HEAD | |
| // ========================================================================= | |
| remove_action('wp_head', 'rsd_link'); // remove really simple discovery link | |
| remove_action('wp_head', 'wp_generator'); // remove wordpress version | |
| remove_action('wp_head', 'feed_links', 2); // remove rss feed links (make sure you add them in yourself if youre using feedblitz or an rss service) | |
| remove_action('wp_head', 'feed_links_extra', 3); // removes all extra rss feed links |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| * Functions Modifications to couple ACF Date time Picker with the GMT offset in WP | |
| * | |
| * To use them, just replace the functions with the ones below. | |
| * Modifications are indicated with <=== MODIFICATION | |
| * | |
| */ | |
| function update_value( $value, $post_id, $field ) { | |
| $field = array_merge($this->defaults, $field); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* ================================================================================ | |
| Custom_Pro_Sites_Stats | |
| A simple class to work with WPMU Dev's Pro Sites Plugin to get basic site details | |
| Available Public Functions: | |
| 1. get_all_blogs_details( ) : Returns an array of details about the blog as follows: | |
| a. ['domain'] => domain name | |
| b. ['start'] => start date of the blog |
NewerOlder