Gravity Forms outside of wordpress

<!-- Snippet 1 - This is for the page template page-gform2.php -->
<style type="text/css">
#gform_wrapper_2{font-family:"Trebuchet MS", Arial, Helvetica, sans-serif}
</style>
<?php gravity_form(2,false,false) ?>

<!-- Snippet 2 - This is the iframe html to display the form -->
<iframe src="http://mydomain.com/gform2/" width="249" height="160"></iframe>

Re-order My Sites

<?php

//Reorder My Sites - Admin Bar
function wco_reorder_my_sites(){
global $wp_admin_bar;
$mysites = $wp_admin_bar->menu->{'my-blogs'}['children'];
unset($wp_admin_bar->menu->{'my-blogs'}['children']);
$pairs = array();
foreach($mysites as $id => $info){ $pairs[$id] = strip_tags($info['title']); }
asort($pairs);
foreach ($pairs as $id => $title){ $wp_admin_bar->menu->{'my-blogs'}['children']->$id = $mysites->{$id}; }
}
add_action('wp_before_admin_bar_render','wco_reorder_my_sites');
?>

Rounded corner fix

#cycle { width: 680px; height: 432px; position: relative; margin: 0 0 20px 0; }
#cycle ul { list-style-type: none; width: 680px; height: 432px; margin: 0; padding: 0; border-radius: 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px; overflow: hidden; }

Child theme option constants

<?php

/* ~~~~~~~~~~~~~ Theme Option Constants ~~~~~~~~~~~~~ */
//Overwrite in child theme functions.php by defining individually or using ter_define_constants()
ter_define_constants(array(
'TER_CONSTANT1' => true,
'TER_CONSTANT2' => 'editor',
'TER_CONSTANT3' => 950
));

/* Define Constants: */
function ter_define_constants($constants){
foreach($constants as $key => $value){
if(!defined($key)) define($key,$value);
}
}

?>

Custom Post Types on "Right Now" Dashboard Widget

add_action( 'right_now_content_table_end' , 'right_now_content_table_end' );

function right_now_content_table_end() {
$args = array(
'public' => true ,
'_builtin' => false
);
$output = 'object';
$operator = 'and';

$post_types = get_post_types( $args , $output , $operator );

foreach( $post_types as $post_type ) {
$num_posts = wp_count_posts( $post_type->name );
$num = number_format_i18n( $num_posts->publish );
$text = _n( $post_type->labels->singular_name, $post_type->labels->name , intval( $num_posts->publish ) );
if ( current_user_can( 'edit_posts' ) ) {
$num = "<a href='edit.php?post_type=$post_type->name'>$num</a>";
$text = "<a href='edit.php?post_type=$post_type->name'>$text</a>";
}
echo '<tr><td class="first b b-' . $post_type->name . '">' . $num . '</td>';
echo '<td class="t ' . $post_type->name . '">' . $text . '</td></tr>';
}

}

Nav menu fallback

<?php

ter_navbar('header');

//Nav Bar - Fallback = Pass false to hide navbar when menu does not exist
function ter_navbar($location = 'primary',$fallback = true){
if(!has_nav_menu($location) && $fallback == false) return;
?>
<nav id="<?php echo $location ?>-nav" class="navigation" role="navigation">
<?php wp_nav_menu(array('theme_location' => $location)) ?>
</nav>
<?php
}
?>

Admin Bar Controller

/* ~~~~~~~~~~~~~ Admin Bar ~~~~~~~~~~~~~~ */

define('TER_LOGIN_ADMIN_BAR',true); //Options = true,false - Show adminbar when logged out
define('TER_ADMIN_BAR','all'); //Options = 'all','admin','editor','none' - Show adminbar when user is logged in

//Admin Bar
function ter_admin_bar(){
if(TER_ADMIN_BAR != 'all') add_action('admin_print_scripts-profile.php','ter_hide_admin_bar_opt');
if(!is_user_logged_in() && TER_LOGIN_ADMIN_BAR == true) return true;
switch(TER_ADMIN_BAR){
case 'all': $hide_bar = false; break;
case 'admin': if(!current_user_can('administrator')) $hide_bar = true; break;
case 'editor': if(!current_user_can('editor')) $hide_bar = true; break;
case 'none': $hide_bar = true; break;
default: $hide_bar = false;
}
if($hide_bar) return false;
else return true;
}

//Login Admin Bar
function ter_login_admin_bar($wp_admin_bar){
if(!is_user_logged_in() && TER_LOGIN_ADMIN_BAR == true) $wp_admin_bar->add_menu(array('title' => __('Log In'),'href' => wp_login_url()));
}

//Admin Bar Options
function ter_hide_admin_bar_opt(){ echo '<style type="text/css">.show-admin-bar{display:none;}</style>'; }

add_action('admin_bar_menu','ter_login_admin_bar');
add_filter('show_admin_bar','ter_admin_bar');

Autoload Class Class

function ter_autoload($class_name){ include $class_name . '.php'; }
spl_autoload_register('ter_autoload');
if(function_exists('__autoload')){ spl_autoload_register('__autoload'); }

$classname  = new ClassName();

Autoload Classes

<?php
function __autoload($class_name) { include $class_name . '.php'; }

$class1 = new class1();
$class2 = new class2();
?>