Skip to content

Instantly share code, notes, and snippets.

@JudeRosario
Last active August 29, 2015 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JudeRosario/5c40d89d35771195198d to your computer and use it in GitHub Desktop.
Save JudeRosario/5c40d89d35771195198d to your computer and use it in GitHub Desktop.
Random Snippets
add_filter( 'wp_nav_menu_items', 'add_loginout_link', 10, 2 );
function add_loginout_link( $items, $args ) {
if (is_user_logged_in() && $args->theme_location == 'primary') {
$items .= '<li><a href="'. wp_logout_url() .'">Log Out</a></li>';
}
elseif (!is_user_logged_in() && $args->theme_location == 'primary') {
$items .= '<li><a href="'. site_url('wp-login.php') .'">Log In</a></li>';
}
return $items;
}
function logo_fix() {
$script =<<<'EOScript'
<script>
jQuery("#image-1427115188808-1592").removeClass("upfront-image");
</script>
EOScript;
echo $script;
}
add_action('wp_footer', 'logo_fix');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment