Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • Sign Up

[Решено] Как удалить выпадающие подкатегории из горизонтального меню?


Recommended Posts

Доброе время суток. Подскажите, что здесь лишнее? Очень нужно чтобы подкатегории не отображались в меню!

	<!-- HEADER BOTTOM -->

	<div class="header-bottom compact-hidden">

		<div class="container">
			<div class="row">
				<div class="header-bottom-left col-lg-10 col-md-9 col-xs-6">
					<?php if ($categories) { ?>
					<nav id="menu" class="navbar">
					    <div class="navbar-header"><span id="category" class="visible-xs"><?php echo $text_category; ?></span>
					      <button type="button" id="show-menu" class="btn btn-navbar navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse"><i class="fa fa-bars"></i></button>
					    </div>
					    <div class="collapse navbar-collapse navbar-ex1-collapse menu-custom ">
					    <span id="remove-menu" class="fa fa-times"></span>
					      <ul class="nav navbar-nav">
					        <?php foreach ($categories as $category) { ?>
					        <?php if ($category['children']) { ?>
					        <li class="dropdown list"><a href="<?php echo $category['href']; ?>" class="dropdown-toggle" data-toggle="dropdown"><?php echo $category['name']; ?></a>
					          <div class="dropdown-menu">
					            <div class="dropdown-inner">
					              <?php foreach (array_chunk($category['children'], ceil(count($category['children']) / $category['column'])) as $children) { ?>
					              <ul class="list-unstyled">
					                <?php foreach ($children as $child) { ?>
					                <li><a href="<?php echo $child['href']; ?>"><?php echo $child['name']; ?></a></li>
					                <?php } ?>
					              </ul>
					              <?php } ?>
					            </div>
					            <a href="<?php echo $category['href']; ?>" class="see-all"><?php echo $text_all; ?> <?php echo $category['name']; ?></a> </div>
					        </li>
					        <?php } else { ?>
					        <li class="list"><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a></li>
					        <?php } ?>
					        <?php } ?>
					      </ul>
					    </div>
				  	</nav>
				  	<?php } ?>
				</div>

 

Link to post
Share on other sites

Это лишнее

 

 <?php if ($category['children']) { ?>
					        <li class="dropdown list"><a href="<?php echo $category['href']; ?>" class="dropdown-toggle" data-toggle="dropdown"><?php echo $category['name']; ?></a>
					          <div class="dropdown-menu">
					            <div class="dropdown-inner">
					              <?php foreach (array_chunk($category['children'], ceil(count($category['children']) / $category['column'])) as $children) { ?>
					              <ul class="list-unstyled">
					                <?php foreach ($children as $child) { ?>
					                <li><a href="<?php echo $child['href']; ?>"><?php echo $child['name']; ?></a></li>
					                <?php } ?>
					              </ul>
					              <?php } ?>
					            </div>
					            <a href="<?php echo $category['href']; ?>" class="see-all"><?php echo $text_all; ?> <?php echo $category['name']; ?></a> </div>
					        </li>
					        <?php }

 

Link to post
Share on other sites

Огромное спасибо!

Если возможно кто-то столкнётся с такой задачей 

в 127 строке ещё нужно удалить 

 }

и в 120 строке 

 else { ?>

 

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.