Advertisement
imranmodel32

Slimmenu in wp

Jun 27th, 2014
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. // header.php
  2.  
  3. <div id="menu" class="col-lg-8 col-md-8">
  4. <?php
  5. if (function_exists('wp_nav_menu')) {
  6. wp_nav_menu(array(
  7. 'theme_location' => 'wpj-main-menu',
  8. 'menu_id' => 'dropmenu',
  9. 'menu_class' => 'slimmenu',
  10. 'fallback_cb' => 'wpj_default_menu'));
  11. }
  12. else {
  13. wpj_default_menu();
  14. }
  15. ?>
  16. </div> <!-- end div #menu -->
  17.  
  18.  
  19. // function.php
  20.  
  21. // add menu support and fallback menu if menu doesn't exist
  22. add_action('init', 'wpj_register_menu');
  23. function wpj_register_menu() {
  24. if (function_exists('register_nav_menu')) {
  25. register_nav_menu( 'wpj-main-menu', __( 'Main Menu', 'brightpage' ) );
  26. }
  27. }
  28. function wpj_default_menu() {
  29. echo '<ul id="dropmenu" class="slimmenu">';
  30. if ('page' != get_option('show_on_front')) {
  31. echo '<li><a href="'. home_url() . '/">Home</a></li>';
  32. }
  33. wp_list_pages('title_li=');
  34. echo '</ul>';
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement