Hi friends,
I want to know iz there any way to remove classes just only from cutom links, Atleast i want to remove these classes from my custom links “current-menu-ancestor current-menu-parent” not from dynamic links.
I use this pease of code:
add_filter('nav_menu_css_class', 'my_css_attributes_filter', 100, 1);
add_filter('nav_menu_item_id', 'my_css_attributes_filter', 100, 1);
add_filter('page_css_class', 'my_css_attributes_filter', 100, 1);
function my_css_attributes_filter($var) {
return is_array($var) ? array_intersect($var, array('current-menu-ancestor current-menu-parent')) : '';
}
it removing css class from all static and dynamic links. i just want to remove css classes from custom links.
Any idea friends.
Iz there Anyone, who can help me.
webdesignerart said
Iz there Anyone, who can help me.
Amio jante chai 
Friends i found solution but i remove classes from all links i just want to remove class from specific link class or link id:
add_filter('nav_menu_css_class', 'my_css_attributes_filter', 100, 1);
add_filter('nav_menu_item_id', 'my_css_attributes_filter', 100, 1);
add_filter('page_css_class', 'my_css_attributes_filter', 100, 1);
function my_css_attributes_filter($classes) {
// if this is not a custom link and not the home page, return the $classes intact, otherwise filter $classes
return is_array($classes) ?
(in_array("menu-item-object-avanza_serv_page", $classes) || is_home())?
array_intersect($classes, array('current-menu-ancestor current-menu-parent'))
: $classes // not a custom link
: ''; // not an array
}
The “menu-item-object-avanza_serv_page” is the class of link which i am going to remove its class.
But this code snipe remove all links classes. not specific.
webdesignerart saidChomotkar… Zodi tor dak shuney keu na ashey tobey ekla cholorey, ekla cholo, ekla cholo, ekla cholo raaaaay
Friends i found solution but i remove classes from all links i just want to remove class from specific link class or link id:add_filter('nav_menu_css_class', 'my_css_attributes_filter', 100, 1); add_filter('nav_menu_item_id', 'my_css_attributes_filter', 100, 1); add_filter('page_css_class', 'my_css_attributes_filter', 100, 1); function my_css_attributes_filter($classes) { // if this is not a custom link and not the home page, return the $classes intact, otherwise filter $classes return is_array($classes) ? (in_array("menu-item-object-avanza_serv_page", $classes) || is_home())? array_intersect($classes, array('current-menu-ancestor current-menu-parent')) : $classes // not a custom link : ''; // not an array }The “menu-item-object-avanza_serv_page” is the class of link which i am going to remove its class.
But this code snipe remove all links classes. not specific.

dmsumon said
webdesignerart saidAmi abaro jante chai
Friends i found solution but i remove classes from all links i just want to remove class from specific link class or link id:add_filter('nav_menu_css_class', 'my_css_attributes_filter', 100, 1); add_filter('nav_menu_item_id', 'my_css_attributes_filter', 100, 1); add_filter('page_css_class', 'my_css_attributes_filter', 100, 1); function my_css_attributes_filter($classes) { // if this is not a custom link and not the home page, return the $classes intact, otherwise filter $classes return is_array($classes) ? (in_array("menu-item-object-avanza_serv_page", $classes) || is_home())? array_intersect($classes, array('current-menu-ancestor current-menu-parent')) : $classes // not a custom link : ''; // not an array }The “menu-item-object-avanza_serv_page” is the class of link which i am going to remove its class.
But this code snipe remove all links classes. not specific.![]()
I am not understanding your language 
- Microlancer Beta Tester
- Sold between 1 000 and 5 000 dollars
- Most Wanted Bounty Winner
- Bought between 10 and 49 items
- Exclusive Author
- Has been a member for 2-3 years
Chomotkar… Zodi tor dak shuney keu na ashey tobey ekla cholorey, ekla cholo, ekla cholo, ekla cholo raaaaay![]()
translate : amazing… if no one comes after listening you, go alone go alone go alone go alone
I don’t know the language(i speak odia) but i guess, its the meaning
Try this: http://pastebin.com/W16cxDfY
itsmattadams said
Try this: http://pastebin.com/W16cxDfY
Thanks mate its bit help me.
kaaz said
Chomotkar… Zodi tor dak shuney keu na ashey tobey ekla cholorey, ekla cholo, ekla cholo, ekla cholo raaaaay![]()
translate : amazing… if no one comes after listening you, go alone go alone go alone go alone
I don’t know the language(i speak odia) but i guess, its the meaning
kaaz@ How did u translate it?? Google translate??? Actually it is a inspiring song in our country and I thought “webdesignerart” is from my country. 
