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 | |
| /** | |
| * Tutorial by: nanodesigns (@nanodesigns) | |
| * URL: http://tuts.nanodesignsbd.com/change-wordpress-password-without-sql-manager/ | |
| * by: Mayeenul Islam (@mayeenulislam) | |
| */ | |
| //Connect to mySQL First | |
| $connection = mysql_connect('DB_HOST','DB_USER','DB_PASSWORD'); | |
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 | |
| function init_url_rewrite_rule(){ | |
| add_rewrite_endpoint( 'edit',EP_PERMALINK | EP_PAGES | EP_ATTACHMENT ); | |
| if(get_option("EDIT_REWRITE_RULE")!=1){ | |
| flush_rewrite_rules(); | |
| update_option("EDIT_REWRITE_RULE",1); | |
| } | |
| } | |
| function redirect_edit_url(){ |
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 | |
| /** | |
| * db QUERIES | |
| * Prerequisite: define('SAVEQUERIES', true) | |
| */ | |
| function nano_enqueue_db_queries() { | |
| global $wpdb; | |
| echo '<h2>Database Last Query</h2>'; | |
| echo $wpdb->last_query; | |
| echo '<hr>'; |
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
| # ---------------------------------------------------------------------- | |
| # | Compression | | |
| # ---------------------------------------------------------------------- | |
| <IfModule mod_deflate.c> | |
| # Force compression for mangled `Accept-Encoding` request headers | |
| # https://developer.yahoo.com/blogs/ydn/pushing-beyond-gzipping-25601.html | |
| <IfModule mod_setenvif.c> |
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 | |
| /** | |
| * Redirect from wp-login.php | |
| * @link http://stackoverflow.com/a/1976804/1743124 | |
| */ | |
| function mayeenulislam_wp_login_redirect(){ | |
| if( isset($_GET['action']) && $_GET['action'] == 'register' ) { | |
| wp_redirect( home_url('/register') ); //i.e. http://example.com/register | |
| exit(); | |
| } else if( isset($_GET['action']) && $_GET['action'] == 'lostpassword' ) { |
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
| .item{ | |
| overflow: auto; | |
| scroll-snap-type: proximity; | |
| scroll-snap-points-x: repeat(300px); | |
| } | |
| /* Source: https://twitter.com/supersole/status/615924334675296256 */ |
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 | |
| /** | |
| * Ascending order search result - WordPress | |
| * @param object $query | |
| * @return void | |
| */ | |
| function wp20150504_alphabetical_search_query( $query ) { | |
| //checking whether we are in the search result page or not | |
| if ( $query->is_search && $query->is_main_query() ) { |
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($) { | |
| var imgs = $('img'); //grabbing all the images of a DOM | |
| imgs.addClass('lazy'); //adding .lazy to all the images | |
| imgs.each(function() { | |
| var img_src = $(this).attr('src'); //grabbing the 'src=""' value of each of the img | |
| $(this).attr('data-original', img_src); //assigning the src value to 'data-original' | |
| $(this).removeAttr('src'); //now deleting the 'src' attribute | |
| }); |
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
| * { | |
| font-size: 12pt; | |
| font-family: monospace; | |
| font-weight: normal; | |
| font-style: normal; | |
| text-decoration: none; | |
| color: black; | |
| cursor: default; | |
| } |