将div内容添加到我的现有菜单

时间:2021-03-04 作者:DmGaming

在过去的几天里,我一直在尝试将我创建的代码添加到我的菜单中。。。没有成功

这是我的代码:https://www.w3schools.com/code/tryit.asp?filename=GO9AAZCNLK4E

至我的网站:https://www.dm-gaming.eu/

这是我尝试的代码的一部分;标题。php“;

<div class="menujeu">
<div class="dropdown">
<button class="dropbtn">HACK & SLASH
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-content">
<?php
wp_nav_menu([
\'theme_location\' => \'menu-under\',
\'container\' => false,
\'menu_class\' => \'menujeu\' ])
?>
<a href="https://www.dm-gaming.eu/chronicon/">Chronicon</a>
<a href="https://www.dm-gaming.eu/diablo-iii/">Diablo 3</a>
<a href="https://www.dm-gaming.eu/diablo-4/">Diablo 4</a>
<a href="https://www.dm-gaming.eu/dreamscaper/">DreamScaper</a>
<a href="https://www.dm-gaming.eu/grim-dawn/">Grim Dawn</a>
<a href="https://www.dm-gaming.eu/Hammerwatch/">HammerWatch</a>
<a href="https://www.dm-gaming.eu/hero-siege/">Hero Siege</a>
<a href="https://www.dm-gaming.eu/Last-Epoch/">Last Epoch</a>
<a href="https://www.dm-gaming.eu/Lost-Ark/">Lost Ark</a>
<a href="https://www.dm-gaming.eu/path-of-exile/">Path of Exile</a>
<a href="https://www.dm-gaming.eu/path-of-exile-2/">Path of Exile 2</a>
<a href="https://www.dm-gaming.eu/warhammer-chaosbane/">Warhammer Chaosbane</a>
<a href="https://www.dm-gaming.eu/Wolcen/">Wolcen</a>
</div>
</div>
非常感谢您的帮助:(

非常感谢!

1 个回复
SO网友:Daiaiai

所以你的链接都是静态的?如果我没有严重错过一些东西,那么你为什么需要wp\\u nav\\u菜单功能呢。您的代码可能如下所示:

<div class="menujeu">
<div class="dropdown">
<button class="dropbtn">HACK & SLASH
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-content">

<a href="https://www.dm-gaming.eu/chronicon/">Chronicon</a>
<a href="https://www.dm-gaming.eu/diablo-iii/">Diablo 3</a>
<a href="https://www.dm-gaming.eu/diablo-4/">Diablo 4</a>
<a href="https://www.dm-gaming.eu/dreamscaper/">DreamScaper</a>
<a href="https://www.dm-gaming.eu/grim-dawn/">Grim Dawn</a>
<a href="https://www.dm-gaming.eu/Hammerwatch/">HammerWatch</a>
<a href="https://www.dm-gaming.eu/hero-siege/">Hero Siege</a>
<a href="https://www.dm-gaming.eu/Last-Epoch/">Last Epoch</a>
<a href="https://www.dm-gaming.eu/Lost-Ark/">Lost Ark</a>
<a href="https://www.dm-gaming.eu/path-of-exile/">Path of Exile</a>
<a href="https://www.dm-gaming.eu/path-of-exile-2/">Path of Exile 2</a>
<a href="https://www.dm-gaming.eu/warhammer-chaosbane/">Warhammer Chaosbane</a>
<a href="https://www.dm-gaming.eu/Wolcen/">Wolcen</a>

<!-- Here your 3rd closing div was missing-->
</div>
</div>
</div>

相关推荐

Html注释导致函数出现问题。php脚本根目录

我注意到HTML注释标记<!-- --> 将导致主题功能出现问题。php脚本,如果它位于脚本的根目录中(不在函数中)我正在处理主题功能。php添加了一些简单的数字下载操作/过滤器,我意识到购买按钮将继续加载,不会将产品添加到购物篮中清除脚本根目录中的html注释后,问题得到解决。我需要知道在函数中使用HTML注释有什么问题。php根目录?(顺便说一句,我的wp站点托管在cpanel共享主机上)