Wordpress Customizr主题添加跨度到导航“a”标签打破网站 [英] Wordpress Customizr theme Adding span to navigation "a" tags breaks site
问题描述
我发布了另外一个关于CSS的问题,但是提出了在导航菜单中为链接标题添加span标签的解决方案。我所拥有的是:
< div>
< li>
< a>
关于我
< / a>
< / li>
< / div>
我想要这样的东西:
< DIV>
< li>
< a>
< span>
关于我
< / span>
< / a>
< / li>
< / div>
然后我发现我可以尝试使用
wp_nav_menu(array(
'link_before'=>'< span>',
'link_after'=>'< / span>'
)
);
继续打破我的网站,导致所有菜单下拉项目只显示在屏幕上我找到的错误是:无法修改标题信息 - 已经发送的标题(输出开始于/ public_html / wp -includes / nav-menu-template.php:256)in /public_html/wp-includes/pluggable.php on line 1210
nav-menu -template.php 256是 echo $ nav_menu;
pluggable.php 1210是标头(Location:$ location,true,$ status);
我很聪明。任何人都知道发生了什么,请帮助。
好吧,我终于明白了。
我刚编辑过这个文件:
这应该得到主题,将 希望这有助于。 I posted another question about CSS but came to the solution of adding span tags to the title of the links in the navigation menu. What I have is: I wanted something like: Then I found that I could probably try using This proceeded to break my site, causing all menu dropdown items to simply display on screen in addition to the "normal" nav bar I have. The error I got was: "Cannot modify header information - headers already sent by (output started at /public_html/wp-includes/nav-menu-template.php:256) in /public_html/wp-includes/pluggable.php on line 1210" nav-menu-template.php 256 is pluggable.php 1210 is I'm at my wits end. Anyone who remotely knows what's going on, please help. Thank you very much in advance! OK guys, I finally got it. I just edited this file: Within you will see This should get the theme to push Hope this helps. 这篇关于Wordpress Customizr主题添加跨度到导航“a”标签打破网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! public_html / wp-includes / nav-menu-template.php $ c $你可以看到
$ defaults
,你应该简单地编辑 link_before
和
link_after
:
$ defaults = array(... 'link_before'=>'< span>','link_after'=>'< / span>',...);
< span> NAVIGATION LABEL< / span>
加入您的所有导航菜单项。
<div>
<li>
<a>
About me
</a>
</li>
</div>
<div>
<li>
<a>
<span>
About me
</span>
</a>
</li>
</div>
wp_nav_menu( array(
'link_before' => '<span>',
'link_after' => '</span>'
)
);
echo $nav_menu;
header("Location: $location", true, $status);
public_html/wp-includes/nav-menu-template.php
$defaults
and you should simply edit link_before
and link_after
:$defaults = array( ...'link_before' => '<span>', 'link_after' => '</span>', ...);
<span>NAVIGATION LABEL</span>
into all your nav menu items.