Add item to nav menu

<?php
function add_login_to_utility_menu($nav, $args){
if($args->theme_location == 'utility_navigation'){
if(is_user_logged_in()) $nav .= "<li id="menu-item-loginout"><a href="" . wp_logout_url("/logged-out/") . "">Logout</a></li>";
else $nav .= "<li id="menu-item-loginout"><a href="/sign-in-or-sign-up/">Sign In or Sign Up</a></li>";
}
return $nav;
}
add_filter('wp_nav_menu_items', 'add_login_to_utility_menu', 10, 2);
?>

Theme activation hooks

//Activate Hooks
ddt_theme_activation_hook('desert_default','ddt_theme_activate');
ddt_theme_deactivation_hook('desert_default','ddt_theme_deactivate');

//Activation Routine
function ddt_theme_activate(){
$first_activation = get_option('desert_default_activated');
if(!$first_activation) update_option('desert_default_activated',1); //Set first activation option
}

//Deactivation Routine
function ddt_theme_deactivate(){
//Code here to run on de-activation
}

//Activation Hook
function ddt_theme_activation_hook($theme,$callback){
$option_name = $theme . "_active";
if(!get_option($option_name)) {
call_user_func($callback);
update_option($option_name,1);
}
}

//Deactivation Hook
function ddt_theme_deactivation_hook($theme,$callback){
$GLOBALS[$theme . '_deactivation_hook_fn'] = $callback;
$action_fn = create_function('$theme',' call_user_func($GLOBALS["' . $theme . '_deactivation_hook_fn"]); delete_option("' . $theme . '_active");');
add_action('switch_theme',$action_fn);
}

Back btn for iframe

<iframe name="codeframe" src="http://FILEURL" style="width:100%; height:60%; background:#fff;"></iframe>
<a href="#" onClick="codeframe.history.go(-1);">back</a>

More default avatars

//Add another default avatar
function mhs_add_avatar($avatar_defaults) {
$myavatar = get_home_url() . '/graphics/avatar.png';
$avatar_defaults[$myavatar] = 'Desert Default Avatar';
return $avatar_defaults;
}
add_filter('avatar_defaults','mhs_add_avatar');

function mhs_add_bp_avatar($url){
return get_home_url() . '/graphics/avatar.png';
}
add_filter('bp_core_mysteryman_src','mhs_add_bp_avatar');

Fake dropdown for a list

<h2>Shop by Brand</h2>

<a id="brandsButton">Select a Brand</a>
<div id="brandsPanel" style="display: none;">
<div class="BlockContent">
<ul>
<li>item 1</li>
<li>item 2</li>
</ul>
</div>
</div>

<script type="text/javascript">
$(document).ready(function(){
$("div#brandsPanel").hide(); $("#brandsButton").click(function () { $("div#brandsPanel").slideToggle("normal"); });
});
</script>

Simple jQuery News Ticker

$(document).ready(function() {
var ticker = function()
{
setTimeout(function(){
$('#recent-posts li:first').animate( {marginTop: '-120px'}, 800, function()
{
$(this).detach().appendTo('ul#recent-posts').removeAttr('style');
});
ticker();
}, 4000);
};
ticker();
});