Adding a bootstrap class to a theme
-
Hi there,
I am using child theme for DevDMBootstrap3 and I am looking for a way to add a class to a <!– <div> –> that has already been defined. That class I am looking to add is the nav-wrapper.I am wondering if there is a way for me to do this without editing the parent (so I don’t lose out if it gets updated). What I need to edit is the template-top-part-nav.php file (shown below)
<?php if ( has_nav_menu( 'main_menu' ) ) : ?> <div class="row dmbs-top-menu"> <nav class="navbar navbar-inverse static-top" role="navigation"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-1-collapse"> <span class="sr-only"><?php _e('Toggle navigation','devdmbootstrap3'); ?></span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> <?php wp_nav_menu( array( 'theme_location' => 'main_menu', 'depth' => 2, 'container' => 'div', 'container_class' => 'collapse navbar-collapse navbar-1-collapse', 'menu_class' => 'nav navbar-nav', 'fallback_cb' => 'wp_bootstrap_navwalker::fallback', 'walker' => new wp_bootstrap_navwalker()) ); ?> </div> </nav> </div> <?php endif; ?>
The class I need to edit is the very first one, where it says
<div class="row dmbs-top-menu">
I need to make it:
<div class="row dmbs-top-menu nav-wrapper">
However, like I said, I want to do this in the child theme if possible in case there is an update to the theme.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Adding a bootstrap class to a theme’ is closed to new replies.