Turning HTML page to wordpress: Trouble Creating Menus
-
So I made a page coded with just HTML because that Is how I know how to make websites. I’ve just recently gotten into turning my HTML pages into wordpress templates, but i’ve only done it for myself. So there are a lot of things I leave just in HTML format because I know how to change it myself if it ever needs to be fixed. For me it is simple. But now I am coding a page for someone else and their big concern is being able to add/remove pages and control the navigation without having to edit any code. So I need to convert the HTML I did for the navigation into wordpress coding.
I already have it styled nice and perfect just the way I want it. I registered the menus in my functions.php file. And I made a nagivation-1.php file for the top menu and a nagivation-2.php file for the menus from a tutorial I saw but I’m not confident on how to edit the given codes for those two files to match my CSS. But here is what I have….
My Nav. in the Functions.php
<?php $themename= 'your theme name'; // This theme uses wp_nav_menu() in two location. register_nav_menus( array( 'primary' => __( 'Main Menu', $themename ), 'secondary' => __( 'Top Menu', $themename ), ) ); ?>
My Navigation-1.php (top/main menu)
<div id="access" role="navigation"> <?php /* Our Main menu. If one isn't filled out, wp_nav_menu falls back to wp_page_menu. The menu assiged to the primary position is the one used. If none is assigned, the menu with the lowest ID is used. */ ?> <?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); ?> </div><!-- #access -->
My Navigation-2.php (bottom/secondary menu)
<?php /* Start add our second page menu */ ?> <div id="pagemenu" role="navigation"> <?php wp_nav_menu( array( 'container_class' => 'page-header', 'menu_class' => 'page-menu', 'theme_location' => 'secondary', 'depth' => 0, 'fallback_cb' => '' ) ); ?> </div> <?php /* End lower page menu */ ?>
The HTML of how I formated my main menu (horizontal)
<div id="menu"> <ul id="ddmenu"> <li class="page_item page-item-41"><a class="loftmenu" href="/site">Home</a> </li> <li><img src="wp-content/themes/TheLoft/img/arrow_down.gif" alt="TheLoft"/></li> <li class="page_item page-item-74"><a class="loftmenu" href="#">About</a> <ul class="menu2"><li class="page_item page-item-106"><a href="#">Nu~Dé</a></li> <li class="page_item page-item-108"><a href="#">J~Lyte</a></li> <li class="page_item page-item-108"><a href="#">Briscoekidd</a></li> </ul></li> <li class="page_item page-item-90"><a class="loftmenu" href="#">Music</a> </li><li class="page_item page-item-99"><a class="loftmenu" href="#">Contact</a> </li> </ul> </div> </div>
My HTML of how i formatted my bottom menu (vertical)
<div style="float: left;"> <div id="pages"> <ul id="nav"> <li class="page_item page-item-41"><a href="#">Home</a></li> <li class="page_item page-item-74"><a href="#">About</a></li> <li class="page_item page-item-90"><a href="#">Music</a></li> <li class="page_item page-item-90"><a href="#">Shop</a></li> <li class="page_item page-item-99"><a href="#">Contact</a></li> </ul> </div> </div>
I just don’t know how to format the wordpress coding. In the code i got from the not-so-tutorial-just-copy-and-paste-but-ask-no-questions “tutorial” i was following (and it was the best one i could find) i’m not sure what to change exactly to it matches what I have
- The topic ‘Turning HTML page to wordpress: Trouble Creating Menus’ is closed to new replies.