Skip to content

Instantly share code, notes, and snippets.

@ksdSnippets
ksdSnippets / gist:4663015
Created January 29, 2013 09:31
WP: Login Page CSS
/******************************************************************
Site Name: xxx
Author: Kevin Salter
Stylesheet: Login Stylesheet
******************************************************************/
#login {
padding: 50px 0 0 0; }
@ksdSnippets
ksdSnippets / gist:4663109
Created January 29, 2013 09:50
WP: Enqueue Scripts in Footer
<?php
// enqueue base scripts and styles
add_action('wp_enqueue_scripts', 'foo_scripts', 999999);
function foo_scripts() {
wp_register_script( 'foo-js', get_stylesheet_directory_uri() . '/library/js/foo.js', array( 'jquery' ), '', true );
wp_enqueue_script( 'foo-js' );
@ksdSnippets
ksdSnippets / gist:4676143
Created January 30, 2013 19:43
WP: Change Howdy Message in Admin
add_filter('gettext', 'change_howdy', 10, 3);
function change_howdy($translated, $text, $domain) {
if (!is_admin() || 'default' != $domain)
return $translated;
if (false !== strpos($translated, 'Howdy'))
return str_replace('Howdy', 'Yo', $translated);
@ksdSnippets
ksdSnippets / gist:4716690
Created February 5, 2013 18:53
WP: MJ's wp-config
<?php
// ===================================================
// Load database info and local development parameters
// ===================================================
if ( file_exists( dirname( __FILE__ ) . '/local-config.php' ) ) {
define( 'WP_LOCAL_DEV', true );
include( dirname( __FILE__ ) . '/local-config.php' );
} else {
define( 'WP_LOCAL_DEV', false );
define( 'DB_NAME', '%%DB_NAME%%' );
@ksdSnippets
ksdSnippets / gist:5073605
Created March 2, 2013 22:44
JS: make console.log safe
// make it safe to use console.log always
(function(b){function c(){}for(var d="assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,timeStamp,profile,profileEnd,time,timeEnd,trace,warn".split(","),a;a=d.pop();){b[a]=b[a]||c}})((function(){try
{console.log();return window.console;}catch(err){return window.console={};}})());
@ksdSnippets
ksdSnippets / gist:5094215
Created March 5, 2013 20:57
JS: push TBS tab ids to URL
var hash = window.location.hash;
hash && $('ul.nav a[href="' + hash + '"]').tab('show');
$('.nav-tabs a').click(function (e) {
$(this).tab('show');
var scrollmem = $('body').scrollTop();
window.location.hash = this.hash;
$('html,body').scrollTop(scrollmem);
});
@ksdSnippets
ksdSnippets / gist:5130172
Created March 10, 2013 19:59
JS: Handsome Curtain Effect
;(function ( $, window, document, undefined ) {
var methods, settings;
var state = 1;
settings = {
animationSpeed: 500,
animationEasing: 'linear',
curtainClass: 'curtain',
curtainLeftClass: 'left',
/************* CUSTOM login PAGE *****************/
function ksd_login_css() {
wp_enqueue_style( 'ksd_login_css', get_template_directory_uri() . ' /css/login.css', false );
}
// changing the logo link from wordpress.org to your site
function ksd_login_url() { return home_url(); }
// changing the alt text on the logo to show your site name
@ksdSnippets
ksdSnippets / gist:5458239
Created April 25, 2013 08:06
WP: Login Page Function File Lines
/************* CUSTOM login PAGE *****************/
function ksd_login_css() {
wp_enqueue_style( 'ksd_login_css', get_template_directory_uri() . ' /css/login.css', false );
}
// changing the logo link from wordpress.org to your site
function ksd_login_url() { return home_url(); }
// changing the alt text on the logo to show your site name
@ksdSnippets
ksdSnippets / gist:5789352
Created June 15, 2013 19:49
WP: Plugin Header Info
<?php
/*
Plugin Name: KS Plugin
Plugin URI: http://kevinsalter.me
Description: A brief description of the Plugin.
Version: 1.0
Author: Name Of The Plugin Author
Author URI: http://kevinsalter.me
*/