admin管理员组

文章数量:1302267

For the past days i've been trying to add my created code to my menu... without success

This is my code : .asp?filename=GO9AAZCNLK4E

To my website : /

This is part of the code I tried in "header.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="/">Chronicon</a>
<a href="/">Diablo 3</a>
<a href="/">Diablo 4</a>
<a href="/">DreamScaper</a>
<a href="/">Grim Dawn</a>
<a href="/">HammerWatch</a>
<a href="/">Hero Siege</a>
<a href="/">Last Epoch</a>
<a href="/">Lost Ark</a>
<a href="/">Path of Exile</a>
<a href="/">Path of Exile 2</a>
<a href="/">Warhammer Chaosbane</a>
<a href="/">Wolcen</a>
</div>
</div>

Help would be very much appreciated :(

Thanks a lot !

For the past days i've been trying to add my created code to my menu... without success

This is my code : https://www.w3schools/code/tryit.asp?filename=GO9AAZCNLK4E

To my website : https://www.dm-gaming.eu/

This is part of the code I tried in "header.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>

Help would be very much appreciated :(

Thanks a lot !

Share Improve this question asked Mar 4, 2021 at 15:56 DmGamingDmGaming 11 bronze badge 1
  • 1 You're missing 1 additional </div> at the very end (or wherever .dropdown-content shall close) – Daiaiai Commented Mar 4, 2021 at 20:02
Add a comment  | 

1 Answer 1

Reset to default 0

So your links are all set static? If I don't miss something badly then why do you need the wp_nav_menu-function then at all. You code could look like so:

<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>

本文标签: htmlAdd div content to my already existing menu