SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast MartyBoi's Avatar
    Join Date
    Dec 2011
    Saginaw MI
    0 Post(s)
    0 Thread(s)

    Question Menu Parameters Issue ( Div to Nav)

    Hello, and thank you for checking out this post.

    I am having an issue when it comes to setting ' Parameters ' to my Header Menu. I am using WordPress 3.1.1, and the HTML5 Blank Theme. I had also Registered my Menus within my ' functions.php ' file. And too I had called my menu within the' header.php ' file template. All seems well, but there is one little problem.

    Because I am using an HTML5 theme, and I want to stay consistent with that. So the issue is I have a ' Div Tag ' wrapping around my Menu, when I should have the new HTML5 Nav Tag wrapping around it.

    I have been to the WordPress Forum, the CSS3Tricks Forum, and a few others, and still I cannot find any solution or fix to help me solve this problem. Sure, I have come across some similar posts in these Forums, and even perhaps wonderful Filters and scripts that could of possibly worked. But I don't know.

    You see, when I seek solutions to my specif issue I seem to come across many ideas, hacks and fix's. And that's great, but there is one problem with that, many whom post their fix's, scripts, filters and so on forget one major importance. That being, they leave out the element of application. Simply put, " where to place the Fix's, scripts and filters ". This can be a huge problem for those with little to no experience with PHP or WordPress. Real Talk! Just Food for thought.

    Moving on !

    My issue has become a headache.... What I need, is to remove the Div Tag and replace it with a Nav Tag. I have tried setting the Parameters as suggested by Codex and WordPress, but yet, that doesn't work. Maybe some one needs to let CODEX and WordPress knows this, I don't know, just an idea . I had also tried using a Filter, well, I don't if that would of worked or not. Since I didn't know where to place the Filter, all I got was a bunch of PHP Errors.

    So, what I am asking is. Is there anyone whom can assist me with removing those darn Div Tags and replacing them with a Nav Tag? Doing in which the instruction are clear, and if there is a Script, Filter, Fix, that I know where exactly where to insert and place such. Perhaps even include the steps, I don't know, but that may be helpful.

    This is the Calling of my Menu that is placed within my header.php

    <!-- Start of Nav Menu --> 
                 <?php wp_nav_menu( array(
    			 'theme_location' => 'header-menu',	
    			   ) ); ?>
                 <!-- End of Nav Menu -->
    This is how I had registered my Menus within my functions.php

    add_action( 'init', 'register_my_menus' );
    	function register_my_menus() {
    			'header-menu' => __( 'Header Menu' ),												
    And this is what the Mark-Up looks like using FireBug
    HTML Code:
    <div class="menu">
    <li class="page_item page-item-2">
    <a href="http://localhost/wordpress/?page_id=2">Sample Page</a>

    So.... What Can I do to solve this problem?

    Thank you....

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Melbourne, AU
    457 Post(s)
    8 Thread(s)
    Hm, all this pain over a version of HTML that doesn't exist yet. Why are you determined to use <nav> when browsers don't recognize it yet? To be honest, you are better off sticking with what's there, although the outer div (like the <nav>) is unnecessary anyway. I know you don't want to hear this, but designers are rushing too fast to use HTML5, when it's not ready for use yet. Hence you have to use all those horrible hacks and fixes, with all their confusion ... to what advantage?)

    Anyhow, the answer is to find where in the WP files that menu code actually resides, and make the change there. I'm afraid I don't know the files well enough to advise where the code is, but it's there somewhere.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts