我想在我的Wordpress菜单中添加一个菜单悬浮动画:
https://www.littlesnippets.net/blog/some-css-menu-inspiration-using-animated-lines
我的Wordpress主题(Avada)以某种方式将内联html样式写入标签:
<ul id="menu-menu" class="fusion-menu">
<li ><a href="#Home" data-hover="Home" **style="overflow: hidden; height: 100px;**"><span class="menu-
text">Home</span></a></li>
<li ><a href="#Events" data-hover="Events" **style="overflow: hidden; height: 100px;**"><span
class="menu-text">Events</span></a></li>
</ul>
...
我将此代码添加到我的functions.php中:
add_filter( 'the_content','the_content_filter',20 );
function the_content_filter( $content ) {
$content = preg_replace('#<a.*?>(.*?)</a>#i','<a>\1</a>',$content);
return $content;
}
但是,这删除了我页面上太多的样式元素。如何调整仅删除类.fusion-menu中的内联样式标签的功能?
感谢您的帮助!