I have one web page it includes the the page sidebar.php.This menu appears at the left side of the web page verticaly.I want this to be on the top of the page and display horizantally.I could not identify the class which keeps it on the left side.I am not posting the css file.Kindly help me to keep it on the top.Though my code is length still iam posting it here.I am net very familiar with css .
<aside id="slide-out" class="side-nav white fixed">
<div class="side-nav-wrapper">
<div class="sidebar-profile">
<div class="sidebar-profile-image">
<img src="../assets/images/profile-image.png" class="circle" alt="">
</div>
<div class="sidebar-profile-info">
<p>Admin</p>
</div>
</div>
<ul class="sidebar-menu collapsible collapsible-accordion" data-collapsible="accordion">
<li class="no-padding"><a class="waves-effect waves-grey" href="dashboard.php"><i class="material-icons">settings_input_svideo</i>Dashboard</a></li>
<li class="no-padding">
<a class="collapsible-header waves-effect waves-grey"><i class="material-icons">apps</i>Department<i class="nav-drop-icon material-icons">keyboard_arrow_right</i></a>
<div class="collapsible-body">
<ul>
<li>Add Department</li>
<li>Manage Department</li>
</ul>
</div>
</li>
<li class="no-padding">
<a class="collapsible-header waves-effect waves-grey"><i class="material-icons">account_box</i>Recommending Officer<i class="nav-drop-icon material-icons">keyboard_arrow_right</i></a>
<div class="collapsible-body">
<ul>
<li>Add Recommending Officer</li>
<li>Manage Recommending Officer</li>
</ul>
</div>
</li>
<!-- <li class="no-padding">
<a class="collapsible-header waves-effect waves-grey"><i class="material-icons">desktop_windows</i>Stationary Type<i class="nav-drop-icon material-icons">keyboard_arrow_right</i></a>
<div class="collapsible-body">
<ul>
<li>Add Stationary Type</li>
<li>Manage Stationary Type</li>
</ul>
</div>
</li>-->
<li class="no-padding">
<a class="collapsible-header waves-effect waves-grey"><i class="material-icons">account_box</i>Employees<i class="nav-drop-icon material-icons">keyboard_arrow_right</i></a>
<div class="collapsible-body">
<ul>
<li>Add Employee</li>
<li>Manage Employee</li>
</ul>
</div>
</li>
<li class="no-padding">
<a class="collapsible-header waves-effect waves-grey"><i class="material-icons">desktop_windows</i>Stationary Management<i class="nav-drop-icon material-icons">keyboard_arrow_right</i></a>
<div class="collapsible-body">
<ul>
<li>Add Stationary Stock</li>
<li>All Stationary Request </li>
<li>Pending Request </li>
<li>Approved Request</li>
<li>Not Approved Request</li>
</ul>
</div>
</li>
<li class="no-padding"><a class="waves-effect waves-grey" href="changepassword.php"><i class="material-icons">settings_input_svideo</i>Chnage Password</a></li>
<li class="no-padding">
<a class="waves-effect waves-grey" href="logout.php"><i class="material-icons">exit_to_app</i>Sign Out</a>
</li>
</ul>
<div class="footer">
<p class="copyright">SMS ©</p>
</div>
</div>
</aside>
Related
I'm using PHP's "include" function to display static elements on all my pages, but the end result is not displaying as it should.
index code:
<?php
require '../../views/sidebar.php';
require '../../views/navbar.php';
?>
<div class="card">
<div class="card-header">
Test
</div>
<div class="card-body">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item">Home</li>
<li class="breadcrumb-item active" aria-current="page">Library</li>
</ol>
</nav>
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
Go somewhere
</div>
</div>
sidebar code:
<nav class="side-navbar">
<div class="side-navbar-wrapper">
<div class="sidenav-header d-flex align-items-center justify-content-center">
<div class="sidenav-header-inner text-center"><img src="../../views/img/logo.jpg" alt="menulogo" class="img-fluid rounded-circle">
<h2 class="h5">Test</h2><span>Dashboard</span>
</div>
<div class="sidenav-header-logo"> <strong>B</strong><strong class="text-primary">D</strong></div>
</div>
<div class="main-menu">
<h5 class="sidenav-heading">Main</h5>
<ul id="side-main-menu" class="side-menu list-unstyled">
<li> <i class="icon-home"></i>Home </li>
<li> <i class="icon-form"></i>Forms </li>
<li> <i class="fa fa-bar-chart"></i>Charts </li>
<li> <i class="icon-grid"></i>Tables </li>
<li> <i class="icon-interface-windows"></i>Example dropdown
<ul id="exampledropdownDropdown" class="collapse list-unstyled ">
<li>Page</li>
<li>Page</li>
<li>Page</li>
</ul>
</li>
<li> <i class="icon-interface-windows"></i>Login page</li>
<li> <a href="#"> <i class="icon-mail"></i>Demo
<div class="badge badge-warning">6 New</div></a></li>
</ul>
</div>
<div class="admin-menu">
<h5 class="sidenav-heading">Second menu</h5>
<ul id="side-admin-menu" class="side-menu list-unstyled">
<li> <i class="icon-screen"> </i>Demo</li>
<li> <a href="#"> <i class="icon-flask"> </i>Demo
<div class="badge badge-info">Special</div></a></li>
<li> <i class="icon-flask"> </i>Demo</li>
<li> <i class="icon-picture"> </i>Demo</li>
</ul>
</div>
</div>
</nav>
this is a snippet from a bootstrapious template I'm using for learning purposes, and the css is both bootstrap and the template's, untouched.
How to split the drop down menus WordPress walker on columns?
How to split the drop-down menus into columns using WP-Bootstrap-Navwalker? as here:dropdown-menu with 3 columns
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<!-- Navigation-->
<nav id="mainmenu" class="navbar navbar-expand-md navbar-dark">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#mainNavbar" aria-controls="navbarToggler" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse justify-content-center" id="mainNavbar">
<ul class="navbar-nav nav-pills ">
<li class="nav-item active">
<a class="nav-link" href="index.html">Home</a>
</li>
<li class="nav-item">
<a class="nav-link " href="page/company.html">page1</a>
</li>
<li class="nav-item dropdown has-megamenu">
Page2
<div class="container-fluid dropdown-menu submenu1 multi-column columns-3 ">
<div class="row">
<div class=" col-md-6 col-lg-4 ">
<ul class="multi-column-dropdown">
<li>
<h4><a class="dropdown-caption" href="page/repairs.html">Header Link</a></h4>
</li>
<li>
<div class="dropdown-divider"></div>
</li>
<li><a class="dropdown-item" href="page/repairs_hydrocylindrs.html">Link</a></li>
<li><a class="dropdown-item" href="page/hydromotors.html">Link</a></li>
<li><a class="dropdown-item" href="page/piston-pumps.html">Link</a></li>
<li><a class="dropdown-item" href="page/hydraulic-distributor.html">Link</a></li>
<li><a class="dropdown-item" href="page/hydro_rotators.html">Link</a></li>
<li><a class="dropdown-item" href="page/dosing_pumps.html">Link</a></li>
<li><a class="dropdown-item" href="page/hydraulic-molot.html">Link</a></li>
</ul>
</div>
<div class=" col-md-6 col-lg-4 ">
<ul class="multi-column-dropdown">
<li>
<h4><a class="dropdown-caption" href="page/diagnostics.html">Header2 Link</a></h4>
</li>
<li>
<div class="dropdown-divider"></div>
</li>
<li><a class="dropdown-item" href="page/diagnostics2.html"> Link</a></li>
<li><a class="dropdown-item" href="page/test_stend.html"> Link</a></li>
</ul>
</div>
<div class="col-md-6 col-lg-4">
<ul class="multi-column-dropdown">
<li>
<h4><a class="dropdown-caption" href="page/diagnostics.html">Header Link</a></h4>
</li>
<li>
<div class="dropdown-divider"></div>
</li>
<li><a class="dropdown-item" href="page/stend.html">Link</a></li>
<li><a class="dropdown-item" href="page/pneumatic.html">Link</a></li>
<li><a class="dropdown-item" href="page/turning_works.html">Link</a></li>
</ul>
</div>
</div>
</div>
</li>
<li class="nav-item dropdown has-megamenu">
Page3
<div class="container-fluid dropdown-menu submenu2 multi-column columns-3 ">
<div class="row">
<div class=" col-md-4">
<ul class="multi-column-dropdown">
<li>
<h4><a class="dropdown-caption" href="page/sale.html"> Header Link</a></h4>
</li>
<li>
<div class="dropdown-divider"></div>
</li>
<li><a class="dropdown-item" href="page/stocks_trumpets.html"> Link</a></li>
<li><a class="dropdown-item" href="page/rod.html"> Link</a></li>
</ul>
</div>
<div class=" col-md-4">
<ul class="multi-column-dropdown">
<li>
<h4> <a class="dropdown-caption" href="page/sale.html">Header Link</a></h4>
</li>
<li>
<div class="dropdown-divider"></div>
</li>
<li><a class="dropdown-item" href="page/making_cylinders.html"> Link</a></li>
<li><a class="dropdown-item" href="page/rvd.html">Link</a></li>
</ul>
</div>
<div class=" col-md-4">
<ul class="multi-column-dropdown">
<li>
<h4> <a class="dropdown-caption" href="page/sale.html">Header Link</a></h4>
</li>
<li>
<div class="dropdown-divider"></div>
</li>
<li><a class="dropdown-item" href="page/new_hydro.html">Header Link</a></li>
</ul>
</div>
</div>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="page/contact.html">Page4</a>
</li>
</ul>
</div>
</nav>
<!-- End navigation-->
<!-- Navigation WordPress-->
<nav id="mainmenu" class="navbar navbar-expand-md navbar-dark">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#mainNavbar" aria-controls="navbarToggler" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<?php
wp_nav_menu( array(
'theme_location' => 'primary',
'depth' => 2, // 1 = with dropdowns, 0 = no dropdowns.
'container' => 'div',
'container_class' => 'collapse navbar-collapse',
'container_id' => 'bs-example-navbar-collapse-1',
'menu_class' => 'navbar-nav mr-auto',
'fallback_cb' => 'WP_Bootstrap_Navwalker::fallback',
'walker' => new WP_Bootstrap_Navwalker()
) );
?>
</nav>
<!-- Navigation-->
Standard menu WP-Bootstrap-Nav Walker.
How to split the drop-down menus into columns using WP-Bootstrap-Navwalker?
I would like to see the options without using different plug-ins for WP
Navwalker dropdown can be split into a specified number of columns using CSS column-count.
Example (target the ul list):
.elementy-ul {
-moz-column-count: 2;
-moz-column-gap: 10px;
-webkit-column-count: 2;
-webkit-column-gap: 10px;
column-count: 2;
column-gap: 100px;
width: 100%;
}
Helpful? Read more on CSS column count
I have this code.When I clicka link in sidebar, it goes to the concerned link and the menu is closed. I want to be opened the link as well as the menu which i have clicked.
I'm designing a 70+ page site that uses a combination of multi-tiered sidebar menus and image maps for navigation, plus breadcrumbs in the navbar to keep track of where you're at.
I want to be able to:
1. open the submenu panels and display the list of menu options available;
2. highlight the menu tree option for the current page; and
3. add the appropriate link for the current page to the breadcrumb pat.
However, when I make a change to the sidebar (e.g., add or delete a menu option, change the grouping or order of the submenu items, etc.), I have to make the exact same change times 70! After 1 or 2 of these revisions, I'd rather not make any more changes!
<div id="sidebar" class="navbar-collapse collapse">
<!-- BEGIN Navlist -->
<ul class="nav nav-list">
<li>
<div class="admin_logo">
<img src="img/logo.png" alt="Inksand Logo">
</div>
</li>
<li>
<a href="index.php">
<i class="fa fa-dashboard"></i>
<span>Dashboard</span>
</a>
</li>
<li>
<a href="#" class="dropdown-toggle">
<i class="fa fa-file-text"></i>
<span>Catalog</span>
<b class="arrow fa fa-angle-right"></b>
</a>
<!-- BEGIN Submenu -->
<ul class="submenu">
<li>
<a href="#" class="dropdown-toggle">
<span>Categories</span>
<b class="arrow fa fa-angle-right"></b>
</a>
<!-- BEGIN Submenu -->
<ul class="submenu">
<li>Add Categories</li>
<li>Manage Categories</li>
</ul>
</li>
<li>
<a href="#" class="dropdown-toggle">
<span>Vendors</span>
<b class="arrow fa fa-angle-right "></b>
</a>
<!-- BEGIN Submenu -->
<ul class="submenu">
<li>Add Vendors</li>
<li>Manage Vendors</li>
</ul>
</li>
<li>
<a href="#" class="dropdown-toggle">
<span>Products</span>
<b class="arrow fa fa-angle-right"></b>
</a>
<!-- BEGIN Submenu -->
<ul class="submenu">
<li>Add Products</li>
<li>Manage Products</li>
</ul>
</li>
</ul>
<!-- END Submenu -->
</li>
<li>
<a href="#" class="dropdown-toggle">
<i class="fa fa-map-marker"></i>
<span>Localization</span>
<b class="arrow fa fa-angle-right"></b>
</a>
<!-- BEGIN Submenu -->
<ul class="submenu">
<li>
<a href="#" class="dropdown-toggle">
<span>Countries</span>
<b class="arrow fa fa-angle-right"></b>
</a>
<!-- BEGIN Submenu -->
<ul class="submenu">
<li>Add Countries</li>
<li>Manage Countries</li>
</ul>
</li>
<li>
<a href="#" class="dropdown-toggle">
<span>States</span>
<b class="arrow fa fa-angle-right"></b>
</a>
<!-- BEGIN Submenu -->
<ul class="submenu">
<li>Add States</li>
<li>Manage States</li>
</ul>
</li>
<li>
<a href="#" class="dropdown-toggle">
<span>Cities</span>
<b class="arrow fa fa-angle-right"></b>
</a>
<!-- BEGIN Submenu -->
<ul class="submenu">
<li>Add Cities</li>
<li>Manage Cities</li>
</ul>
</li>
<li>
<a href="#" class="dropdown-toggle">
<span>Areas</span>
<b class="arrow fa fa-angle-right"></b>
</a>
<!-- BEGIN Submenu -->
<ul class="submenu">
<li>Add Areas</li>
<li>Manage Areas</li>
</ul>
</li>
<!--
<li>
<a href="#" class="dropdown-toggle">
<span>Misc</span>
<b class="arrow fa fa-angle-right"></b>
</a>
BEGIN Submenu
<ul class="submenu">
<li>Order Status</li>
<li>Payment
</ul>
</li>
-->
</ul>
<!-- END Submenu -->
</li>
<li>
<a href="#" class="dropdown-toggle">
<i class="fa fa-bar-chart-o"></i>
<span>Sales</span>
<b class="arrow fa fa-angle-right"></b>
</a>
<!-- BEGIN Submenu -->
<ul class="submenu">
<li>Order</li>
<li>Shipment</li>
<li>Return</li>
<li>Payment</li>
</ul>
<!-- END Submenu -->
</li>
<li>
<a href="#" class="dropdown-toggle">
<i class="glyphicon glyphicon-list"></i>
<span>Stock</span>
<b class="arrow fa fa-angle-right"></b>
</a>
<!-- BEGIN Submenu -->
<ul class="submenu">
<li>Add Stock</li>
<li>Manage Stock</li>
<li>Manage Garbage</li>
</ul>
<!-- END Submenu -->
</li>
<li>
<a href="#" class="dropdown-toggle">
<i class="fa fa-money"></i>
<span>Tax</span>
<b class="arrow fa fa-angle-right"></b>
</a>
<!-- BEGIN Submenu -->
<ul class="submenu">
<li><a href=add-tax-master.php>Add Tax</a></li>
<li><a href=tax-master.php>Manage Tax</a></li>
</ul>
<!-- END Submenu -->
</li>
<li>
<a href="#" class="dropdown-toggle">
<i class="fa fa-user"></i>
<span>Customers</span>
<b class="arrow fa fa-angle-right"></b>
</a>
<!-- BEGIN Submenu -->
<ul class="submenu">
<li>Manage Customers</li>
</ul>
<!-- END Submenu -->
</li>
<li>
<a href="#" class="dropdown-toggle">
<i class="fa fa-cog"></i>
<span>Tools</span>
<b class="arrow fa fa-angle-right"></b>
</a>
<!-- BEGIN Submenu -->
<ul class="submenu">
<li>Banner</li>
<li>Backup</li>
<li>Setting</li>
</ul>
<!-- END Submenu -->
</li>
<li>
<a href="#" class="dropdown-toggle">
<i class="fa fa-file-text-o"></i>
<span>Report</span>
<b class="arrow fa fa-angle-right"></b>
</a>
<!-- BEGIN Submenu -->
<ul class="submenu">
<li>
<a href="#" class="dropdown-toggle">
<span>Sales</span>
<b class="arrow fa fa-angle-right"></b>
</a>
<!-- BEGIN Submenu -->
<ul class="submenu">
<li>Order</li>
<li>Tax</li>
<li>Shipping</li>
<li>Return</li>
</ul>
</li>
<li>
<a href="#" class="dropdown-toggle">
<span>Products</span>
<b class="arrow fa fa-angle-right"></b>
</a>
<!-- BEGIN Submenu -->
<ul class="submenu">
<li>Viewed</li>
<li>Purchased</li>
</ul>
</li>
<li>
<a href="#" class="dropdown-toggle">
<span>Vendors</span>
<b class="arrow fa fa-angle-right"></b>
</a>
<!-- BEGIN Submenu -->
<ul class="submenu">
<li>Vendor</li>
</ul>
</li>
<li>
<a href="#" class="dropdown-toggle">
<span>Customers</span>
<b class="arrow fa fa-angle-right"></b>
</a>
<!-- BEGIN Submenu -->
<ul class="submenu">
<li>Order</li>
<li>Cart</li>
<li>Wishlist</li>
</ul>
</li>
</ul>
<!-- END Submenu -->
</li>
</ul>
<!-- END Navlist -->
<!-- BEGIN Sidebar Collapse Button -->
<div id="sidebar-collapse" class="visible-lg">
<i class="fa fa-angle-double-left"></i>
</div>
<!-- END Sidebar Collapse Button -->
You need to add active class to item you want to be opened.
For example:
<ul class="submenu">
<li class="active">Add Categories</li>
<li>Manage Categories</li>
</ul>
top open Category menu and highlight "Add Categories" item.
I need help creating a custom WordPress menu. WordPress Adds its own classes that I don't need. I need someone to help me solve this issue. WordPress doesn't add some attributes when I need them on drop-down.
Here is my HTML code.
<nav class="navbar navbar-default navbar-static-top">
<div class="container-fluid container">
<div class="row m04m">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#main_nav">
<span class="bars">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</span>
<span class="btn-text">Select Page</span>
</button>
</div>
<div class="collapse navbar-collapse" id="main_nav">
<ul class="nav navbar-nav">
<li class="active ">Home</li>
<li class=" dropdown">
About
<ul class="dropdown-menu" role="menu">
<li>Company Profile</li>
<li>Board of directors</li>
<li>Owner's message</li>
<li>team</li>
</ul>
</li>
<li>
projects
</li>
<li class=" dropdown">
Media
<ul class="dropdown-menu" role="menu">
<li>Gallery</li>
<li>documents</li>
</ul>
</li>
<li class=" dropdown">
news
</li>
<li class=" dropdown">
contact
<ul class="dropdown-menu" role="menu">
<li>Conact us</li>
<li>Careers</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</nav> <!--Main Nav-->
What you are looking for is the Walker class in WordPress. It's built in and can help you create custom navigation amongst other things.
You can read more about it here: https://codex.wordpress.org/Class_Reference/Walker
Attached is the code snippet of my navigator
<!-- Navigator -->
<div style="position:abolute;top:50px" class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<ul id="yw0" class="nav">
<li class="active">Company</li>
<li><a style="color:black" href="#"><i class="fa fa-lightbulb-o"></i> FAQs</a></li>
<li><a style="color:black" href="#"><i class="fa fa-question-circle"></i> Help Center</a></li>
<li><a style="color:black" href="#"><i class="fa fa-newspaper-o"></i> Press</a></li>
<li><a style="color:black" href="#">Careers</a></li>
<li><a style="color:black" href="#"><i class="fa fa-envelope-o"></i> Contact Us</a></li>
</ul>
</div>
</div>
</div>
<!-- Content -->
I am actually trying to put a logic that whenever I click on a link , it should renderPartial the appropriate file and also highlight the menu below the navigator.. I tried doing the following <a href="<?php $this->renderPartial("company",false); ?>"
But I guess it is not the right way.. dunno how can I achieve it?
This will go into your view file
<!-- Navigator -->
<div style="position:abolute;top:50px" class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<ul id="yw0" class="nav">
<li class="active">Company</li>
<li><a onclick="showData('user')" style="color:black" href="#"><i class="fa fa-lightbulb-o"></i> FAQs</a></li>
<li><a style="color:black" href="#"><i class="fa fa-question-circle"></i> Help Center</a></li>
<li><a style="color:black" href="#"><i class="fa fa-newspaper-o"></i> Press</a></li>
<li><a style="color:black" href="#">Careers</a></li>
<li><a style="color:black" href="#"><i class="fa fa-envelope-o"></i> Contact Us</a></li>
</ul>
</div>
</div>
</div>
<div class="main-content">
<div id="company" class="renderContent">
<?php $this->renderPartial("company",false); ?>
</div>
<div id="user" class="renderContent">
<?php $this->renderPartial("user",false); ?>
</div>
<!--- for every menu item there should be a view rendered here--->
</div>
<!-- Content -->
this will go into your js
function showData(id) {
$('.renderContent').hide();
$('.nav li').removeClass('active');
$(this).addClass('active');
$('#'+id).show();
}
$('.renderContent').hide();