Skip to content

Instantly share code, notes, and snippets.

@lschatzkin
lschatzkin / wp-create-custom-gallery.php
Created February 18, 2013 23:26
Custom gallery call for custom templates
@lschatzkin
lschatzkin / jetpack.php
Created February 21, 2013 18:28
Modify Jetpack to work in local environment, no WordPress.com account needed. This is found on line 276 of jetpack.php
/**
* Is Jetpack active?
*/
//public static function is_active() {
// return (bool) Jetpack_Data::get_access_token( JETPACK_MASTER_USER );
//}
/* modify Jetpack to work for local environment */
public static function is_active() {
return true;
}
@lschatzkin
lschatzkin / tl_create_gallery.php
Created February 25, 2013 23:23
Genesis custom gallery function
@lschatzkin
lschatzkin / custom-gallery-shortcode.php
Created February 28, 2013 17:15
custom gallery shortcode for WordPress
@lschatzkin
lschatzkin / kill spam comments
Created May 7, 2013 22:40
delete all SPAM (unapproved) comments in MySQL, using SequelPro / PHPAdmin / command line.
DELETE FROM wp_comments WHERE comment_approved=0
@lschatzkin
lschatzkin / wp-admin-plugin
Created May 23, 2013 19:15
how to style wp admin
You make a plugin, then add a wp-admin.css to the folder. Here's some sample code for both the php and the css.
reference: http://codex.wordpress.org/Creating_Admin_Themes
blah-blah-admin-theme.php:
<?php
/*
Plugin Name: Client-Name Admin Theme
Plugin URI: http://techliminal.com
Description: Client-name Admin Theme, styling for the administration screens for Properties
@lschatzkin
lschatzkin / change-custom-post-type
Last active March 8, 2017 23:54
How to Change a Custom Post Type from one Custom Post Category to Another
Example:
To move custom posts from Activity to Explore the Area (in this case, Airports, Transportation):
- wp3p_posts: get the ID for an example custom post (ex. 430)
change palms_activity to palms_explore for each post that needs to be moved
- wp3p_term_relationship: find the term_taxonomy_id by object_id (ex.430=post ID, term_taxonomy_id = 30)
- wp3p_term_taxonomy: change tl_activity_cat to tl_explore_cat where term_taxonomy_id (in this case, = 30)
@lschatzkin
lschatzkin / dreamhost-nameservers
Created May 29, 2013 21:50
change Nameservers on Dreamhost
Go to Domains > Registrations
Find domain
Click the blue Whois button
Choose nameservers from dropdown on top of page
@lschatzkin
lschatzkin / dropdown-arrows
Created June 11, 2013 21:19
dropdown arrows for nav menu items with sub-items
#nav-menu li > a:after {
color: #888;
content: ' ▾';
}
#nav-menu li > a:hover:after {
color: #444;
content: ' ▾';
}
@lschatzkin
lschatzkin / jquery-no-conflict.js
Created June 13, 2013 20:33
jquery no conflict call
jQuery(document).ready(function($) {
$yourFunction(){}
}