# Mobile navbar doesnt work

**URL:** https://discourse.roots.io/t/mobile-navbar-doesnt-work/1997
**Category:** uncategorized
**Created:** 2014-07-24T13:26:22Z
**Posts:** 14

## Post 1 by @lewix66 — 2014-07-24T13:26:23Z

mobile navigation menu doesnt work at all. do you know why ?

[http://garveydoyle.ie/sitenew/about-us/](http://garveydoyle.ie/sitenew/about-us/)

also where to add media queries in new roots theme ? before was in app file .

---

## Post 2 by @cfx — 2014-07-24T13:51:17Z

Two reasons your navbar isn’t working on mobile: (1) Your JavaScript is missing and (2) your `.navbar-toggle` is present but its background color is set to transparent.

In Roots 7 you can add media queries in any of the `assets/less/` files and they should end up in your stylesheet.

---

## Post 3 by @lewix66 — 2014-07-24T14:04:51Z

what javascript is missing? i havent delete any js file. I dont have any errors at all.

---

## Post 4 by @cfx — 2014-07-24T14:57:42Z

Your `scripts.js` file is nowhere to be found.

Please re-read the documentation on the new Grunt workflow and commands.

---

## Post 5 by @lewix66 — 2014-07-24T15:12:32Z

dont understand what you mean:  
can you tell me what to do please.

Previously, every time you updated your CSS or JS (or minified files), changes to lib/scripts.php had to be committed to the repo. The repo no longer includes any generated front-end assets. Grunt tasks are now split into: dev and build.

dev: runs JSHint, compiles your LESS (non-minified) and concatenates your JS.  
build: task runs JSHint, compiles and minifies your LESS, runs UglifyJS for concatenation and minification, generates a lean Modernizr build, and revisions CSS and JS based on the hashes.  
During build, assets-manifest.json is generated with the names of the revisioned files. lib/scripts.php reads that file and tells WordPress the correct path to the assets.

---

## Post 6 by @lewix66 — 2014-07-25T09:08:27Z

can you please tell me what to do ? i read again but dont understand :frowning:

---

## Post 7 by @cfx — 2014-07-25T14:27:49Z

What did you try and which part do you not understand?

---

## Post 8 by @lewix66 — 2014-07-28T09:16:55Z

1. npm install grunt
2. grunt watch

Dont understand that Grutn tasks are split into de and build. Dont know how to install the JS .

Do I need to type some command. In the previous version was working without anything. thanks

---

## Post 9 by @cfx — 2014-07-28T13:32:52Z

See this post: [How to correctly add bxslider to my theme](http://discourse.roots.io/t/how-to-correctly-add-bxslider-to-my-theme/1952/12)

---

## Post 10 by @lewix66 — 2014-07-28T16:14:04Z

so i ran these 3 commands and still nothing: i am not using bedrock so added line to wp-config

grunt dev — Compile LESS to CSS, concatenate and validate JS  
grunt watch — Compile assets when file changes are made  
grunt build — Create minified assets that are used on non-development environments  
If you set define(‘WP\_ENV’, ‘development’); in your wp-config.php then Roots will not use minified assets.

still my navbar doesnt work :frowning:

---

## Post 11 by @cfx — 2014-07-28T16:36:34Z

It also looks like you probably have an error in your PHP somewhere near the sidebar. This is what I see when I view your site’s source:

![](https://discourse.roots.io/uploads/default/80/f402ad7224c973d2.png)

---

## Post 12 by @lewix66 — 2014-07-29T13:04:18Z

yes there is the issue, but i want to use on home page - header-home and on any page header.php. I am using this code

\<?php do\_action('get\_header'); // Use Bootstrap's navbar if enabled in config.php if (is\_page('Home')) { get\_template\_part('templates/header-home'); } else { get\_template\_part('templates/header'); } ?\>

why this is not working ? thanks

---

## Post 13 by @lewix66 — 2014-07-29T13:35:36Z

ok. solved. has to be added to config.php. thanks for help cfx

---

## Post 14 by @cfx — 2014-07-29T18:00:53Z

Sure thing, glad you got it sorted.
