admin管理员组文章数量:1125794
I created my own custom theme with wordpress and now I want to add english language to my site (defualt is persian rtl). for this I installed polylang. I create menu in wordpress like this:
functuions.php:
<?php
//Add Custom classes to the a tag of menu
function add_menu_link_class($atts, $item, $args)
{
if (isset($args->a_class)) {
$atts['class'] = $args->a_class;
}
return $atts;
}
add_filter('nav_menu_link_attributes', 'add_menu_link_class', 1, 3);
and for showing the menu I coded in header.php:
wp_nav_menu(array(
'theme_location' => 'top',
'container_id' => 'main-menu',
'container_class' => 'collapse navbar-collapse mt-lg-0 mt-3 ms-lg-5',
'menu_class' => 'navbar-nav me-auto mb-2 mb-lg-0',
'a_class' => 'nav-link mx-lg-3 p-lg-0 px-lg-0 px-3s'
));
before I installed the polyland all classes added to the menu tags perfectly. but when the plugin installed all custom tags are cleared. how can I fix this issue?
Also any other tips that can get to make this plugin compatible with my theme would be appreciated.
本文标签: phpmake my custom theme support polylang plugin
版权声明:本文标题:php - make my custom theme support polylang plugin 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736673376a1947045.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论