Skip to content

Instantly share code, notes, and snippets.

View KryptikOne's full-sized avatar
:octocat:
Slaying Code Dragons ⚔️🐲🧑🏽‍💻

Jason KryptikOne

:octocat:
Slaying Code Dragons ⚔️🐲🧑🏽‍💻
View GitHub Profile
@KryptikOne
KryptikOne / robots.txt
Created October 3, 2014 15:07
Robots.txt that allows everything
User-agent: *
Allow: /
@KryptikOne
KryptikOne / wp-increase-upload-size.php
Last active September 9, 2015 19:38
Increase default file upload size from 2MB to 64MB for Wordpress.
// What you may need to change in the server's php.ini configuration
upload_max_filesize = 64M
post_max_size = 64M
// What you may need to change in .htaccess
php_value upload_max_filesize 64M
php_value post_max_size 64M
// What to add to functions.php file in theme
@ini_set( 'upload_max_size' , '64M' );
@KryptikOne
KryptikOne / enable-gzip
Created September 18, 2014 15:18
Enabling gzip compression in htaccess
<IfModule deflate_module>
<IfModule filter_module>
AddOutputFilterByType DEFLATE text/plain text/html
AddOutputFilterByType DEFLATE text/xml application/xml application/xhtml+xml application/xml-dtd
AddOutputFilterByType DEFLATE application/rdf+xml application/rss+xml application/atom+xml image/svg+xml
AddOutputFilterByType DEFLATE text/css text/javascript application/javascript application/x-javascript
AddOutputFilterByType DEFLATE font/otf font/opentype application/font-otf application/x-font-otf
AddOutputFilterByType DEFLATE font/ttf font/truetype application/font-ttf application/x-font-ttf
</IfModule>
</IfModule>
@KryptikOne
KryptikOne / wp-custom-login-css-and-js.php
Last active May 29, 2019 19:09
Add Custom Styles/Scripts to the Wordpress Login Page
<?php
// Don't add the custom_login_css unless you want to have a custom css on the login page.
add_action('login_head', 'custom_login_css');
function custom_login_css() {
echo '<link rel="stylesheet" type="text/css" href="' . get_bloginfo('template_url') . '/admin/css/login.css" />';
}
// Not sure the above actually works but this definitely does
// Add an /admin directory in the root of your theme and place the following files in it
@KryptikOne
KryptikOne / wp-pagination.php
Last active August 29, 2015 14:06
WP Pagination
<?php
function awesome_wp_pagination( $loop_query ) { // $loop_query == What you would add for a custom query, other wise it will paginate based off of the posts per page setting in the settings and will only paginate based on the global WP_Query
if( is_singular() )
return;
global $wp_query; // This is the Global Query Option, remove if you want to use Custom Query Option
// $loop_query = $loop_query; // This is the Custom Query Option
@KryptikOne
KryptikOne / getting-base-url.js
Created August 19, 2014 16:25
Getting the different parts of the base URL
console.log(window.location.protocol);
console.log(window.location.hostname);
console.log(window.location.port);
console.log(window.location.pathname);
console.log(window.location.hash);
console.log(window.location.protocol + '//' + window.location.host + '/');
@KryptikOne
KryptikOne / wp-database-move
Created August 11, 2014 23:55
MySQL queries to run on the database to update URL's when moving a Wordpress Database
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl');
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl');
@KryptikOne
KryptikOne / wp-curl-command
Last active August 29, 2015 14:03
Download Wordpress via the command line, unzip and move it to the current directory, then delete the downloaded tar.gz and empty Wordpress folder.
curl -O https://wordpress.org/latest.tar.gz; tar -zxvf latest.tar.gz; cd wordpress; mv * ../; cd ..; rm -Rf latest.tar.gz; rm -Rf latest.tar.gz; rm -Rf wordpress; mv wp-content wp-content-orig;
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="style.css">
<title>Draggable</title>
</head>
/* ===| Dropcaps |=== */
.drop-cap:first-letter {
float: left;
margin: 0;
padding: 0.125em 0.125em 0 0;
font-size: 6em;
font-family: Copperplate;
line-height: 0.5;
text-indent: 0;
background: transparent;