Advertisement
firoze

Dropdown Menu code For Functions.php

Oct 28th, 2014
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.56 KB | None | 0 0
  1. // add menu support and fallback menu if menu doesn't exist
  2.     add_action('init', 'wpj_register_menu');
  3.     function wpj_register_menu() {
  4.         if (function_exists('register_nav_menu')) {
  5.             register_nav_menu( 'wpj-main-menu', __( 'Main Menu', 'brightpage' ) );
  6.         }
  7.     }
  8. // For using  <UL> if we use id or class like <ul id=”dropmenu” class=””>
  9.     function wpj_default_menu() {
  10.         echo '<ul id="dropmenu">';
  11.         if ('page' != get_option('show_on_front')) {
  12.             echo '<li><a href="'. home_url() . '/">Home</a></li>';
  13.         }
  14.         wp_list_pages('title_li=');
  15.         echo '</ul>';
  16.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement