View Full Version : Wordpress Pages Dropdown Menu
morestar
05-12-2011, 08:37 AM
Hello and great day Wordpress Gurus.
I need a little WebProWorld.com assistance here with a Wordpress install I'm working on.
The theme I'm using is Elements of SEO (http://wordpress.org/extend/themes/elements-of-seo) but I'm not sure if there's native code within Wordpress itself that can make all the Sub Pages flyout or dropdown from the menu item of it's parent.
So my question is, is it a must that I use a plugin or can I simply add something from the Wordpress codex? I'm not too sure.
And yes I've searched around but I'd like some hometown responses if you will. I do work with Wordpress on a day to day basis but I'm always open to learning to things about Wordpress on a day to day basis.
Thanks in advance for your input.
;)
morestar
05-12-2011, 08:39 AM
OK I JUST found this, but with a search for a plugin (http://pixopoint.com/products/pixopoint-menu/), of which I'm trying to refrain from doing...
morestar
05-12-2011, 08:54 AM
No, that didn't work. The theme I'm using places a set of Page links at the top, in the header with the following code:
<?php wp_list_pages('title_li=&depth=1'); ?>
Can I not simply edit this to ensure the page's child elements flyout or dropdown? Please??
morestar
05-12-2011, 09:05 AM
I edited the code above to the following:
<?php wp_list_pages('title_li=&depth=2'); ?>
...and that simply displayed the child elements which is not what I'm looking for...
Do you have an example of what you are trying to accomplish? You mean more of a fancy drop down menu or the old school select list with options inside it?
morestar
05-12-2011, 10:29 AM
Well I'm not too worried about the styling at the moment (if that's what you mean) just the functionality.
I could very easily just code the dropdown but I want the keep the core intact (for this particular install).
I was hoping and still looking for a way to edit the line of code above or maybe check a setting in the Dashboard that would enable this...
Just to clarify, I have a top level menu called "services" and pages with that page as the parent.
With the code above it simply displays the parent page, or if I add '2' to the parameters it'll display their child pages but not in any decent menu form (dropdown, flyout)...
I'l get it sometime today for sure Rah, no worries and one of the Gurus is hopefully getting out of bed soon!
;)
somethingelse
05-12-2011, 05:21 PM
If you've upgrade to the current version, you should be able to simply add the call for wp_nav_menu to your theme files... If you haven't upgraded... why not???
see here - http://codex.wordpress.org/Function_Reference/wp_nav_menu
i've successfully just copied the associated functions & template tags from the TwentyTen theme into older themes... you'll need to spend some time messing about with your CSS to style them how you want, but it's pretty straightforward to add the functionality.
requires changes to your functions.php file and your header.php file (MAKE BACKUP COPIES FIRST)
a more expert WP user may further advice, and it's possible i just lucked out with the themes i chose... so no promises.
a better alternative might be to upgrade to a newer theme - that Elements of SEO is 3 years old! WP has changed a lot since then, and you may be missing out on a lot of great new functionality and features.
morestar
05-12-2011, 05:35 PM
If you've upgrade to the current version, you should be able to simply add the call for wp_nav_menu to your theme files... If you haven't upgraded... why not???
see here - .codex.wordpress.org/Function_Reference/wp_nav_menu
i've successfully just copied the associated functions & template tags from the TwentyTen theme into older themes... you'll need to spend some time messing about with your CSS to style them how you want, but it's pretty straightforward to add the functionality.
requires changes to your functions.php file and your header.php file (MAKE BACKUP COPIES FIRST)
a more expert WP user may further advice, and it's possible i just lucked out with the themes i chose... so no promises.
a better alternative might be to upgrade to a newer theme - that Elements of SEO is 3 years old! WP has changed a lot since then, and you may be missing out on a lot of great new functionality and features.
I'm a tad confused at your post Something, yes the install of Wordpress is updated but I've been on that page 80 times today and swear I can't find anything on it that will help me make a drop-down or fly-out menu.
I feel bad now cause I changed my mind on using a drop-down, I'm going with the Flyout from the left sidebar but to be honest I couldn't find anything on that page you referenced that would help me, nor apply to my CSS.
For the flyout menu, I went along with the Multi-level Navigation Plugin (http://wordpress.org/extend/plugins/multi-level-navigation-plugin/) which is somewhat working. As it stands, the menus aren't flying outward but are being displayed under the parent page after mousing over the parent link - which is fine for now but I'm obviously going to have to configure the plugin through it's settings or the CSS before I launch...
Or if someone posts the ingenious code I'm looking for!
;)
There are some plugins for creating drop down menu's in any theme but you can also create one as you mention. I can't post links until I reach ten messages though so search Google for the terms "edit wordpress to create a drop down menu" think thats what I used and I clicked on the top link.
alienpest
05-12-2011, 07:26 PM
The default WP theme has dropdown for the nav menu. I know you are trying to use another theme, but if you looked at the navigation code in the editor, you might be able to transpose it over to the other themes code. Just a thought. It may be wrongheaded, but that's the sort of thing I would try.
alienpest
05-12-2011, 07:29 PM
I just re-read the thread, and realized that I missed the part about keeping "the core in tact". Sorry about that.
slimwoman
05-12-2011, 09:51 PM
On my main domain, I am using intrepidity Theme by Top Blog Formula on wordpress. I have drop down menus and just set the 'parent' in the wordpress dashboard when adding pages. I am not a programmer so I have no wisdom about doing what you are asking. The above comment makes sense to try but I would definitely keep a copy of original code before altering the css.
C0ldf1re
05-13-2011, 01:40 AM
... a search for a plugin (http://pixopoint.com/products/pixopoint-menu/) ...
This sounded good, until I looked at their demo site. A demo that does not work properly hardly inspires confidence.
pepnak
05-22-2011, 03:02 AM
There is a method for generating the fly-outs (to the side of a menu item) or drop-downs beneath menu items using CSS 2.1 display none or block specifications for the menus in question. Menus and sub-menus (children of menus or li > ul ) are rendered by wordpress as unordered lists and display or specifications can be triggered by the li:hover pseudo-element specifications. For example, to display a positioned child menu ul with default display spec'ed as "none", you could use a css spec that reads: li:hover > ul{display: block;} (hope that showed up) where li:hover refers to the parent menu. Whether it is a drop-down or fly-out with respect to the parent menu item depends on how you positioned the hidden child menu (ul) to begin with.
I have a site which you can grab the CSS out of if you wish. It's not the most aesthetically perfect example of fly-outs and drop-downs, but the basics are there. PM me for the URL.
Ravenhawk
05-23-2011, 03:50 PM
From what I understand what you are looking for the menus that you want you should be able to create using the custom menu builder in your wordpress admin area. If that is not what your looking for I have an article here jQuery menus (http://www.johnoverall.com/wordpress-plugins-from-a-to-z-episode-30-jquery-menus/) that provides a nice starting list of plugins to handle custom menus.