Book Image

WordPress 5 Complete - Seventh Edition

Book Image

WordPress 5 Complete - Seventh Edition

Overview of this book

Back in the day, when you wanted to launch a new website, you either had to learn web programming yourself or hire a professional who would take care of the whole process for you. Nowadays, with WordPress, anyone can build an optimized site with the least amount of effort possible and then make it available to the world in no time. Here, in the seventh edition of the book, we are going to show you how to build great looking and functional websites using WordPress. The new version of WordPress – 5.0 – comes with a few important changes, and we tell you all about how to use them effectively. From crafting content pages using the block editor, and customizing the design of your site, through to making sure it's secure, we go through it all. The book starts by introducing WordPress and teaching you how to set it up. You are then shown how to create a blog site, start writing content, and even use plugins and themes to customize the design of the site and add some unique elements to set it apart. If you want to get more in-depth, we also show you how to get started creating your own themes and plugins. Finally, we teach you how to use WordPress for building non-blog websites. By the end of the book, you will be sufficiently skilled to design high-quality websites and will be fully familiar with the ins and outs of WordPress.
Table of Contents (18 chapters)
Free Chapter
1
Section 1: WordPress
6
Section 2: Customizing WordPress
14
Section 3: Non-Blog Websites

Enabling a menu in your theme

The good news I have for you right now is that menus are already enabled in the structure of the theme we're creating here. Because we used the wp_nav_menu() function in the header of the site (in the header.php file), if the user creates a menu in Appearance | Menus, and then assigns it to the area indicated as Primary Menu, it will show up on the site, as demonstrated in the following screenshot:

If you want to have more than one navigation menu in your theme, you can register multiple navigation menu locations, let the user create multiple menus, and choose which menu goes in which location. To learn more about this, check out the Codex at https://codex.wordpress.org/Navigation_Menus.

Learning more
The wp_nav_menu() function is quite powerful, and can take a number of parameters that will let you control the classes and IDs, the name of the...