Tips for Choosing Certain List Items in a Responsive Bootstrap Navigation Menu for WordPress

I've put together a sleek bootstrap navbar menu for WordPress. If you want to check out the menu design, you can view it by clicking on this link: here

There are still some tweaks that need to be made though. Specifically, I need to add a box around the top "Special Promotions" and "Board Certified" tabs to make them stand out more. To see what I'm talking about, visit this link: here

Here's the HTML code:

<!-- Menu's Code for Twitter Bootstrap -->
<div class="navbar navbar-inverse container mainmenu" role="navigation">
<div class="navbar-header">
    <button type="button" class="navbar-toggle" data-toggle="collapse"   data-target=".navbar-collapse">
        <span class="sr-only">Toggle Naavigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
    </button>
    <a class="navbar-brand" href="" >Navigation</a>
</div>
<div class="navbar-collapse collapse">
    <?php

    $args = array(
            'theme_location' => 'top-bar',
            'depth'          => 2,
            'container'      => false,
            'menu_class'     => 'nav navbar-nav',
            'walker'         => new Bootstrap_Walker_Nav_Menu()
    );
    wp_nav_menu($args);

    ?>
 </div>
 </div>
 <!-- Menu's Code for Twitter Bootstrap -->

Check out the CSS code below:

.mainmenu {background:#F2F0F1;border:none;margin-top:10px;margin-bottom:10px;}
.navbar-inverse .navbar-brand {color: #101010;}
.navbar-inverse .navbar-brand:hover {color: #101010;}
.navbar-inverse .navbar-toggle {border-color: #333333;background:#333333;}
.navbar-collapse {padding-right: 0px;padding-left: 0px;}
.navbar-brand {display:none;}
.mainmenu ul.navbar-nav {margin-left: -10px;}
.mainmenu ul.navbar-nav li {margin-top: 12px;margin-left: 10px;}
.mainmenu ul.navbar-nav li a {color:#101010;padding: 5px 2px;font-family: 'Open Sans', sans-serif;font-size:18px;}
.mainmenu ul.navbar-nav li a:hover {color:#fff;background:#13B4E3;}

To activate the Bootstrap navbar menu for WordPress, I use the following code in functions.php: http: // pastebin dot com/S0UCDUYi.

If anyone can help me with fixing these issues, I would greatly appreciate it. Thank you!

Answer №1

If you want to customize the styling of specific menu items on your Wordpress website, follow these steps:

  • First, navigate to the Wordpress | Appearance | Menus page
  • Ensure you can view CSS classes by following these steps:
    • Go to the menu editing page
    • Click on Screen Options located at the top right of the screen
    • Under 'Show advanced menu properties', check the box for 'CSS Classes'
  • Now, in the menu entries for the “Special Promotions” and “Board Certified” pages, add a new class like 'highlight'
  • Next, include the CSS for the new class:
.highlight { background: blue ... }

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Inject a <div> element into a table row upon clicking a button using jQuery and PHP

I am faced with an issue regarding displaying pdf reports within specific table rows. The scenario involves a table containing folder paths and buttons in each row. Upon clicking the button, the path is sent to a sequence of PHP files (ajax.php, ajax2.php, ...

Adjust the background color of a specific list item when hovering over another list item

My dilemma lies in my inadequate knowledge to solve this issue: I have a dropdown menu embedded within a website. (View screenshot here: [SCREENSHOT]) The desired outcome is for the background color of an icon on the main list to change when I navigate to ...

Is it possible to utilize the event load function while offline with a text file?

Is there a way to load a div that I have saved as plain text (in a file)? The file is located in the same root directory as my HTML page. I am attempting to call this file using jQuery's event load on my HTML page like this: $("#tab2").load("textfile ...

Having issues with Json stringification and serializing arrays

Having an issue with Json when using serializeArray. An example of my HTML form: <form action="" method="post" name="myForm"> ID: <input type="text" name="id" /><br/> State (XX): <input type="text" name="state" /><br/> <p ...

Publishing Your App on the Android Market with PhoneGap

Seeking a comprehensive PhoneGap tutorial that covers app publishing, especially struggling with successful app deployment. Currently experienced in HTML, CSS, and JavaScript. Any tips or advice would be greatly appreciated, thank you! I have a good gras ...

Unexpected syntax error occurs while retrieving data from web API using jQuery AJAX request

I'm attempting to retrieve a json object from the following URL: You may not understand much as it's in Greek, but the format is json. Below is the code snippet I'm using: function getDicts() { api_url = 'https://test3.diavgeia.gov ...

Exploring the Differences: innerHTML versus appendChild for Loading Scripts

Struggling to dynamically load scripts onto the DOM? function addScript(fileName) { document.body.innerHTML += `<script src='components/${fileName}/${fileName}.js'></script>` } addScript('message-interface') I prefer th ...

Unable to execute a JavaScript function when triggered from an HTML form

This is the code for a text conversion tool in HTML: <html> <head> <title> Text Conversion Tool </title> <script type="text/javascript"> function testResults(form) { var str = form.stringn.value; var strArray = str.split(" ...

Creating an image from the contents of a div is necessary in order to visually

I am looking to develop a software that can: receive text input from the user and place it in a specific div allow users to adjust font, color, and size based on their preferences enable image uploads as background save all customizations and send them v ...

Combining selected boxes through merging

Looking to create a simple webpage with the following requirements: There should be 10 rows and 3 boxes in each row. If I select 2 or more boxes or drag a box, they should merge together. For example, if my initial screen looks like this: and then I se ...

Notify users with a prompt when a modal or popup is closed on Google Chrome extensions

I have developed a Google Chrome extension for setting timers and receiving alerts. Currently, the alert only goes off when the extension is open, but I want it to fire even when the extension is closed. This extension currently requires the window to be ...

Adjust the height for just one md-tab

Looking to find a way to set the height of the content within an <md-tab> element to be 100% in a flexible manner. For example, consider the following structure: <body> <md-content> <md-tabs> <md-tab label= ...

Are there any JQuery events that can detect alterations in the list of children elements within an element?

Is there a JQuery event available that can detect changes in the size of an element collection, such as growth or reduction resulting from adding or removing child elements? ...

What might be causing the in-viewport javascript to not work in my code?

Why is my in-viewport JavaScript code not functioning properly? Link to JSFiddle code When the Click to move button is clicked, the cat image will slide correctly. However, when implementing the following code: if($("#testtest").is(":in-viewport")) ...

Are you looking to test your website's performance under limited bandwidth conditions

Similar Query: How can I test a website for low bandwidth? Would it be possible to mimic a slow internet connection to test my website's performance? I need to simulate lower speed conditions in order to observe how the site behaves. ...

The component I created seems to be having trouble recognizing the Slickr CSS that was

I have included Sick carousel's CSS in the root component by importing it like this: import React from 'react' import PropTypes from 'prop-types' import { ThemeProvider } from 'styled-components' import { ...

Create a payment invoice using the power of AJAX, jQuery, PHP, and MySQL

Having issues with my bill calculation. When adding multiple products, the price of all products appears to be the same. I'm unable to calculate the total correctly and struggling to fix this. Please review my code and provide insights. bill.php < ...

Preparing data before using Kendo UI upload function is essential

I need to pass a data (specifically a GUID) to the upload method of the kendoUpload, so that a particular MVC Controller action method can receive this data each time the upload occurs. $("#propertyAttachmentUpload").kendoUpload({ async: { ...

Converting a JavaScript variable into a jQuery object

Is there a way to transform this JavaScript variable and make it into a jQuery object as $(myFragment) alter the id attribute from "fragment" to "fragment1"? myFragment = "\ <div id='fragment'>\ <input type='hidde ...

Is there a way for an inline element like <a> to enclose block level elements within it?

<a href="#"> <h1>Our Premier Package</h1> <h2>The top choice among our clients</h2> <p> Enjoy expanded storage and quicker assistance to guarantee constant access to your cruci ...