Parent Page Remain Active without Dropdown

Is there a way when using Wordpress’ menu feature to:

a) remove the dropdown and caret functionality from navbar on the parent page
b) keep the parent page on the navbar active when viewing a child page?

Or should I just use some advanced php?



function roots_cpt_active_menu($menu) {
  if (is_page('child')) {
    $menu = str_replace('active', '', $menu);
    $menu = str_replace('menu-parent', 'menu-parent active', $menu);
  return $menu;
add_filter('nav_menu_css_class', 'roots_cpt_active_menu', 400);

replace the word child and parent with the slugs of actual pages.

Thanks so much! The second bullet point on ‘A’ did the trick.

Though, is there a way to have this apply to the primary navigation and not secondary?

you can use wp_nav_menu_args filter ( like so:

function modify_nav_menu_args($args = '') {
  if($args['theme_location'] == 'secondary_navigation') {
    $args['depth'] = 2;
  return $args;
add_filter('wp_nav_menu_args', 'modify_nav_menu_args');

just change the name secondary_navigation to the name you used to register the menu.