menus – add another html tag after li element in wp_nav_menu

Question

I have a nav menu in footer. I just want to display it side by a <p> tag, I mean something like this

<ul>
<li>
<p>copyright C 2021</p>
</li>
<li>
contact
</li>
<li>
blog
</li>
</ul>

this is my menu function

if ( function_exists( 'register_nav_menus' ) ) {
    register_nav_menus(
        array(
          'top_nav_menu' => 'My Footer Menu'
        )
    );

and I’m calling it in footer

<?php if ( has_nav_menu( 'top_nav_menu' ) ) { ?>
            <?php wp_nav_menu( array(
                'menu' => 'Footer Navigation Menu', 
                'theme_location' => 'top_nav_menu', 
                'menu_class' => 'footer-links'
                )); 
            ?>
            <?php } else {?>
            <ul class="sf-menu">
                <?php wp_list_pages( array('title_li' => '','sort_column' => 'menu_order')); ?>
            </ul>
            <?php } ?>

How can I insert an extra <li> element just before its first <li> and add a <p> tag between that later added <li> element?

0
DaF-Student 2 weeks 2021-03-28T14:30:16-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse