Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I've registered a custom menu and got all that set up, however the formatting of the HTML that the menu uses doesn't fit with the CSS/HTML menus I had previously and want to keep.

Therefore I was wondering If there was a way to use the custom menu but echo your own HTML code for the menus.

WordPress Generated HTML:

<div class="menu-home-nav-container">
    <ul id="menu-home-nav" class="menu">
        <li id="menu-item-17" class="menu-item menu-item-type-custom menu-item-object-custom current-menu-item current_page_item menu-item-home menu-item-17">
            <a href="http://localhost/PMD-new/">Home</a>
        </li>
        <li id="menu-item-18" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-has-children menu-item-18">
            <a href="http://localhost/PMD-new/?page_id=10">About</a>
            <ul class="sub-menu">
                <li id="menu-item-19" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-19">
                    <a href="http://localhost/PMD-new/?page_id=14">What we do</a>
                </li>
                <li id="menu-item-20" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-20">
                    <a href="http://localhost/PMD-new/?page_id=12">Who we are</a>
                </li>
            </ul>
        </li>
    </ul>
</div>

My Custom HTML:

<div class="postit-surround">
    <a href="#">
    <div class="postit">
        <div class="pin">
              <img src="<?php echo get_template_directory_uri(); ?>/assets/drawing-pin.png">
        </div>
        <div class="postit-title">
              <h1 class="nav-title-text">Products</h1>
        </div>
        <div class="corner-peel">
              <img src="<?php echo get_template_directory_uri(); ?>/assets/corner-flick-cyan.png">
        </div>
    </div>
</a>
<div class="navigation-dropdown">
     <ul>
        <li>
            <h2 class="dropdown-text">Products 1</h2>
        </li>
        <li>
            <h2 class="dropdown-text">Products 2</h2>
        </li>
    </ul>
</div>
share|improve this question
    
Please elaborate on what had you tried or looked into and how technical are you. Customizing menus is (of course) possible, but not particularly trivial task. –  Rarst May 16 at 15:13
    
I've not tried anything as of yet, mainly because I've been trying to think of a way to link the custom menu and a php statement to include the echo. I know how to customise the current generated code no problem, but I want to it be the same as my HTML but with the integration of the custom menu and GUI. –  Mallander May 16 at 15:21
    
You will need a custom Walker if I am reading the question right. –  s_ha_dum May 16 at 15:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.