Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.
add_filter('wp_nav_menu_items', 'add_line', 10, 2);
function add_line($items, $args) {
  if ($args->theme_location == 'primary') {
    // my code here
  }
  return $items;
}

Instead of the above, which uses "theme_location" to target a specific menu, can I target a nav menu via its id/class name instead?

share|improve this question
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.