Add item to WordPress menu

<?php

function hyp_add_menu_item($items,$args){
if($args->theme_location == 'primary'){
$items .= '<li><a href="http://hyperspatial.com">hyperspatial.com</a></li>';
}
return $items;
}
add_filter('wp_nav_menu_items','hyp_add_menu_item',10,2);

?>

0 Comments

You must be logged in to post a comment.