I'm trying to add a custom PHP script inside of the nav menu (before the closing ) and struggling.
Code here:
<?php
wp_nav_menu(array(
'theme_location' => 'menu-1',
'menu_id' => 'primary-menu',
'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s<div class="my-div">' . $addCats . '</div></ul>'
));
$addCats = require_once('custom_menu_addon.php');
?>
The above code includes the file outside of the new added to the menu:
Any recommendations for getting this to print inside the div? Am I using the wrong command to pull the file contents there?
Thank you in advance for your help and guidance! <3
<div>
as a direct child of an<ul>
, that's invalid HTML.