The wordpress logout way requires you to redirect to their logout page. Nice way is to use a custom url, in this case pointing to /logout, and code (no need to create page)
if ($_SERVER["REQUEST_URI"] == '/logout')
{
wp_logout();
wp_redirect( home_url( '/' ) );
die;
}
