Home > Backend Development > PHP Tutorial > Let the theme support menu navigation in wordpress

Let the theme support menu navigation in wordpress

WBOY
Release: 2016-07-25 09:08:20
Original
991 people have browsed it
  1. 1. The folder used by the theme is in the theme folder corresponding to wp-content/themes/
  2. There is -----functions.php in the theme (the functions used by the theme are mainly in this), in this Add the following code to the file:
  3. register_nav_menus(array('header-menu' => __( 'Navigation custom menu' ),));//That is, register the navigation menu
  4. 2, in the header in the theme folder used. php file, put the original
  5. blog
  6. Comment out, replace
  7. with
  8. 'header-menu' )); ?>Code
  9. 3, in Set up in the background menu
  10. Create a new menu -> The options on the right can be added to the menu -> Theme location selection to use the navigation menu name
  11. Remember to save every step!
Copy code


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template