WordPress.org

Support

Support » How-To and Troubleshooting » Prevent "$after" character from appearing after last menu item

Prevent "$after" character from appearing after last menu item

  • I’m using the following code in the footer menu on my website:

    <div class="footerNav"> <?php wp_nav_menu( array( 'container_class' => 'footer-menu', 'theme_location' => 'footer', 'after' => ' | ' ) ); ?></div>

    Notice I’m using a pipe ‘ | ‘ character for the after option.

    My last item in the menu shows up as ‘Contact Us | ‘

    Is there a way to prevent the ‘after’ option from showing up after the last menu item?

    Thanks!

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Prevent "$after" character from appearing after last menu item’ is closed to new replies.
Skip to toolbar