Make your own WordPress drop down menu
When it comes to creating a site that has multi-level navigation, a drop down menu is often your best means of keeping the navigation simple and uncluttered. There are a few plugins that you can use to achieve this, but I’ve found that many of them make too many assumptions and don’t work exactly how I’d like them too. For that reason, I’ll detail a simple means of making your own WordPress drop down menu.
Here’s a demo of what we’re going to accomplish. (Tested in IE7 & FF)
Getting started
Firstly, you’ll need to setup your pages in WordPress in a hierarchal manner. IE:
- Home Page
- About Us
- What We Do
- What We’ve Done
- Who Works For Us
- Services
- Portfolio
- Our Clients
- Contact Us
This will generate a nested UL LI list in your code.
<ul id="nav"> <li><a href= "#">Home Page</a></li> <li><a href= "#">About Us</a> <ul id="aboutus"> <li><a href= "#">What We Do</a></li> <li><a href= "#">What We've Done</a></li> <li><a href= "#">Who Works For Us</a></li> </ul> </li> <li><a href= "#">Services</a> <ul id="services"> <li><a href= "#">Portfolio</a></li> <li><a href= "#">Our Clients</a></li> </ul> </li> <li><a href= "#">Contact Us</a></li> </ul>
Sorted?
Making it dynamic
What you’re going to do now, is break that list down somewhat and create your own navigation. The top level menu items will be static, and their subpages will be dynamic. Like so:
<ul id="nav">
<? wp_list_pages('title_li=&sort_column=menu_order'); ?>
</ul>
You might also want to include a home link. You can add this manually like so:
<ul id="nav">
<li><a href="<? bloginfo('siteurl'); ?>">Home</a></li>
<? wp_list_pages('title_li=&sort_column=menu_order'); ?>
</ul>
The Script
There’s a tiny piece of jQuery required to show/hide the drop down menu’s. From an accessibility point of view, you can link the top level navigation item so that if JS is disabled, the user will still be able to get around your site. Here’s the script.
$(document).ready(function() {
$("#nav ul").css({display: "none"}); // Opera Fix
$("#nav li").hover(function(){
$(this).find('ul:first').css({visibility: "visible",display: "none"}).show(); },function(){ $(this).find('ul:first').css({visibility: "hidden"}); });
});
The CSS
This CSS is really a guide and it largely depends on the styling of your site. The important thing is to add “position:relative;” to the first level of LI elements. The UL element (the drop down menu) needs to have “position:absolute;” so the parent LI needs to be relatively positioned to your dropdown menu doesn’t display topleft corner of the page.
/*navigation*/
#nav {padding:0;margin:0;}
#nav li {position:relative;display:block;float:left;}
#nav li a {display:block;float:left;height:30px;line-height:30px;padding: 0 20px;}
/*sub navigation*/
#nav ul {position:absolute;top: 30px;left:0;padding:0;} /*the top:30px command must be the same height as your parent LI so the dropdown displays below the main navigation*/
#nav ul a, #nav ul li {float:none;}
This is the CSS used to achieve the effect in the demo. You can of course change it to suit your site’s styles.
And presto, you’ll have a drop down menu. As you add sub pages in your WP admin, those pages will automatically be included in your drop down.
Slick



This way you can easily compare quotes from the different
companies online. Ask your Insurance company to give a different
home insurance quote for the different amounts of excess e.
Along with these, it also includes threats against bursting
pipes, falling objects, weight of snow, ice, sleet, hot water heater overflow, heating, air conditioning systems
and electrical surge damage.
In instances of senior citizens driving, the frequency of minor accidents on the other hand may be greater.
If you are having trouble securing coverage, check with an insurance company you already use, for instance for renter’s or life insurance. Fortunately, a no deposit car insurance policy can make payment more manageable and may be available to you depending on your location.
I hope this simple Rank Tracker Word – Press
Plugin Review will assist you to differentiate whether
Rank Tracker Word – Press Plugin is Scam or a Genuine. With ping check you can check if a website
is online or offline. Backlink checker allows you to check how many links that website has on its web pages.
The healthcare expenses historically rise year over year, often faster than general inflation.
I am always on the lookout for affordable health insurance.
The denial of a medical claim is more challenging
than you think.
I feel this is among the most vital information for me.
And i am satisfied studying your article. But wanna
commentary on few general things, The website taste is wonderful,
the articles is truly great : D. Just right task, cheers
Including your primary keywords into your anchors is crucial for ranking well for the
keyword. SEO Spyglass will tell you the exact anchor texts and anchor URLs your competitors
are using anchor text being the clickable part of the link.
Still confused about the unparalleled advantages of
using backlink checker.
This can be accomplished by calling the IRS and discussing your financial situation with them.
Drivers who smoke while driving can get more easily distracted by
their burning cigarettes, and these distractions can cause accidents.
Although Flo does her best to help you understand Snapshot, let me give you a quick breakdown and my honest opinion on this new piece of technology offered by Progressive Insurance in Arizona.
There are many other factors that make outsourcing a great solution for healthcare providers.
They understand that maintaining a healthy workforce is directly related to maintaining a healthy bottom line.
But while dealing with these insurance advisors you need be cautious that they will not misguide you, for avoiding this do some
homework for these policies.
This applies to all legal matters, but in the case of automobile accidents, it is an especially
essential point because of the complexity and speed of these incidents.
Huangpu The City, Zhongshan Local, the us govenment had said the main mayor
is definitely off seolin, Huangpu Urban Center, 2008, annual formulating valuation of over 200 oven market
sectors billion, marketing in order to community for more than
60% of business end result. You have to be liable for your buying and not allow your craves
get in your way.
One advantage of this can be a repairs will be guaranteed generally up to several years.
This is obviously a huge advantage if your circumstances change and your policy requirements alter.
You could potentially rent an auto or you can borrow an auto from a
friend so you can react quickly.
If you are an avid cyclist then you may want to consider adding bicycle cover
to your home insurance. When you fill out our Compare
Quotes request form, we connect you with
numerous home insurance companies from your area so that you can make a wise
decision. A poor credit rating puts in a higher risk category and leads
to higher premiums.
It may not be as simple as we’d like to believe because most bankruptcies filed in this country due to medical debt are actually filed by people who thought they were covered by health insurance. Try to find out if the free health insurance quotation being offered allows you to use the services of your personal doctor and hospital of choice or is restricted to their network of health care providers. It’s also necessary
that I stress that there are steps that might put you at risk
even if they help you make savings for now.
If you are aware of a pre-existing condition, a good agent can
help you explain it on the application in the most favorable
light. Don’t duped by means of appearances; can see the most competitive amount does not always assure that this plan is providing the lowest price. It is not easy to follow the steps because they read simple but are pretty difficult when executed practically due to time and planning the consumers need to do.
I visited multiple sites except the audio feature for audio
songs current at this site is in fact wonderful.
Ease of setting up and the quickness with which you may be insured can make
this specific insurance item incredibly beneficial in emergency or unforseen circumstances.
Right now, the Cleveland forecast is looking, once again, cloudier than not.
The complete bottom line is you simply can’t drive any motor vehicle without insurance cover in position for protection.
Non owner auto insurance is one of the most misunderstood coverage in the insurance industry.
Day by day insurance in place may permit you to drive the motor vehicle home safely and securely entirely
covered by a comprehensive insurance policy. With an online car insurance company, everything becomes
so easy.
You have the option of paying your insurance premium either online or via phone at the
selected insurers. If you’re unable to find a better deal then of course you can simply renew the policy you already have. You will observe we now have a great deal of types as well as alternatives manufactured to protect the many parts of our everyday life.
In this situation one might require temporary insurance for
the borrower, remaining the car owner claim bonus
with you. You will learn numerous insurance companies offering short lived insurance policy coverage
and it is up to you to decide which one can provide you the most desirable support.
Do you have a long commute in peak hour traffic or do you catch public transport and
do most of your driving on the weekends.
Unfortunately, these 5 issues combined to multiply the market miscalculations artificially and exponentially.
This is obviously a huge advantage if your circumstances change and your policy requirements alter.
In cases where you’re planning on beginning a savings account, the interest rates that the bank offers is vital.
The Federal Communications Commission may assess a fine of up to $11,000 per violation.
Connecticut residents have yet another choice for great healthcare policies with Anthem
Blue Cross and Blue Shield including dental, life insurance, and pharmacy benefits.
Since COBRA bills average $1,000 a month for family coverage, this can be a huge concern.
Your report offers proven necessary to us.
It’s really useful and you are naturally really well-informed in this area.
You possess opened our face to be able to various thoughts about this topic
using intriquing, notable and reliable written content.
Every weekend i used to pay a quick visit this web page, because
i want enjoyment, for the reason that this this site conations actually good funny data too.
Great information. Lucky me I came across your website by accident (stumbleupon).
I’ve book-marked it for later!
Hello there, I found your website by means of Google whilst searching for a comparable topic, your web site got here up, it appears good. I’ve bookmarked to favourites|added to bookmarks.
The post features confirmed necessary to myself.
It’s quite helpful and you really are naturally quite experienced in this area.
You possess opened up my eyes to various views on this topic
along with intriquing, notable and strong written content.