Skip to content

Instantly share code, notes, and snippets.

View jchck's full-sized avatar

justin chick jchck

  • Brooklyn, NY
View GitHub Profile
@jchck
jchck / plugin.php
Created October 23, 2012 16:31
WP Plugin
<?php
/*
Plugin Name:JustinChick Setup
Plugin URI: http://justinchick.com
Description:Set up custom functions for all Justin's sites, yay!
Version: 1.0
Author: Justin Chick
Author URI: http://justinchick.com
*/
/*Add Content After This*/
/*This gives you an oval shape*/
#stuff{
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
-o-border-radius: 15px;
}
/*This gives you a kinda wonky shape*/
#stuff{
-moz-border-radius: 1em 4em 1em 4em;
border-radius: 1em 4em 1em 4em;
-o-border-radius: 1em 4em 1em 4em;
}
@jchck
jchck / wp-template-url.php
Created October 23, 2012 20:55
Get WP template url
<?php echo get_template_directory_uri(); ?>
<?php echo get_template_directory_uri(); ?>/folder1/folder2/picture.png
// init hoverdir.js
$(function() {
$(' #work_thumbnail_container > li ').each( function() { $(this).hoverdir(); } );
});
@jchck
jchck / gist:48521c7592e2fbd6d6f4
Last active August 29, 2015 14:10
wp-config.php database settings
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'database_name_here');
/** MySQL database username */
define('DB_USER', 'username_here');
/** MySQL database password */
define('DB_PASSWORD', 'password_here');
@jchck
jchck / gist:662fcee4fb031f920121
Created December 7, 2014 00:09
SQL Query to Add WP User
INSERT INTO `databasename`.`wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES ('21', 'username_here', MD5('password_here'), 'Justin Chick', 'hey@justinchick.com', 'http://justinchick.com/', '2014-12-06 00:00:00', '', '0', 'Justin Chick');
INSERT INTO `databasename`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '21', 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}');
INSERT INTO `databasename`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '21', 'wp_user_level', '10');
@jchck
jchck / gruntfile.js
Created June 16, 2015 17:02
Gruntfile.js with Uncss
'use strict';
module.exports = function(grunt) {
// Load all tasks
require('load-grunt-tasks')(grunt);
// Show elapsed time
require('time-grunt')(grunt);
var jsFileList = [
'assets/js/plugins/bootstrap/transition.js',
//'assets/js/plugins/bootstrap/alert.js',
/**
* @link http://cfxdesign.com/remove-unused-css-from-wordpress-automatically-with-grunt
*/
function show_sitemap() {
if(WP_ENV === 'development' && isset($_GET['show_sitemap'])) {
$the_query = new WP_Query(array('post_type' => 'any', 'posts_per_page' => '-1', 'post_status' => 'publish'));
$urls = array();
while($the_query->have_posts()) {
$the_query->the_post();
$urls[] = get_permalink();