Skip to content

Instantly share code, notes, and snippets.

@lschatzkin
lschatzkin / gist:3405ede11c1c0f6b3c3f
Created May 20, 2014 17:48
WordPress: Hide content-box on specific pages in admin
function remove_editor() {
if (isset($_GET['post'])) {
$id = $_GET['post'];
$template = get_post_meta($id, '_wp_page_template', true);
if($template == 'template_name.php'){
remove_post_type_support( 'page', 'editor' );
}
}
}
@lschatzkin
lschatzkin / page.php
Created March 4, 2014 17:34
Bay Nature page.php
<?php get_header(); the_post(); ?>
<!-- content -->
<div id="content" class="left">
<?php display_breadcrumbs() ?>
<div class="post">
<?php display_title(); ?>
<div class="entry">
<?php the_content(); ?>
</div>
</div>
@lschatzkin
lschatzkin / generate ssh key
Last active March 8, 2017 23:53
generate ssh key via command line
ps -e | grep [s]sh-agent // see if agent is running
ssh-agent // see if agent is running
ssh-add -l // list keys
ssh-keygen -t dsa -f ~/.ssh/id_dsa -C "yourname@gmail.com" // add key id_dsa ***MAKE A NOTE OF THE PASSCODE!***
ssh-add ~/.ssh/id_dsa // add keys to agent
ssh-add ~/.ssh/id_dsa.pub
ssh -T git@bitbucket.org -v // check to see if connection to Bitbucket is working
// If ssh-add returns "Could not open a connection to your authentication agent." error.
exec ssh-agent bash
@lschatzkin
lschatzkin / css3 cross browser
Created July 16, 2013 17:43
css3 cross browser
.class-name {
-khtml-css3-property: 3px;
-moz-css3-property: 3px;
-webkit-css3-property: 3px;
css3-property: 3px;
}
@lschatzkin
lschatzkin / jquery-no-conflict.js
Created June 13, 2013 20:33
jquery no conflict call
jQuery(document).ready(function($) {
$yourFunction(){}
}
@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 / 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 / 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 / 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 / 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