Closed imranhsayed closed 2 years ago
Thank you for the quick reply and the PR. I did try something similar to yours but was missing the _self and didn't do $link_target but target. Thanks again it works.
Hope you don't mind I ask another question. I wrote a function for Highlighting active menu it works but I can't keep the parent active when the child menu item is selected.
Here is the function function wp_check_active_menu( $menu_item ) { $actual_link = ( isset( $_SERVER[ 'HTTPS' ] ) ? "https" : "http" ) . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
if ( $actual_link == $menu_item->url ) {
return 'active-link';
}
return '';
}
and then I added this to the anchor link like this... <a class=" class="<?php echo ycmihoc_check_active_menu( $menu_item ); ?>">
It works for the parent but just can't get it work for the child.
Again I really appreciate you taking the time to fix the link target.
Added anchor target for menu items