Custom WP Page Widgets
My next step is to add my custom category menus to my site as custom widgets. Depending on the theme you use on your WordPress site, this particular step may actually not be possible. I am using the Weaver II theme that offers this particular feature. There are other ways this could be done (with free plugins, for example - search “per page widget”), if you are not using this theme. The idea here is to have a custom menu in the sidebar of the pages of my site. However, I want to use a total of three different menus, and only one of those should show up at a time depending on what page they are viewing. To start, I need a new plugin on the site to help me do something that Weaver II actually doesn't allow me to do. First, click on Plugins -> Add New. Then search for and install a plugin called Shortcode Menu. When this plugin is installed, you'll have a new menu link: Now click on Shortcode Menus in the sidebar to get to the admin page for this plugin. At the top, look for the Select Menu drop-down box. Then, just pick one of the menus you've created. At the bottom, notice the text show up in the green box. This is called a shortcode - everything from the opening bracket [ through the closing bracket ]. Simply copy the shortcode provided and paste it into a Notepad file to use later. Now, repeat this process for all of your menus so you have shortcodes for each one. Next, I need to create a widget that can be used on select pages to show a specific menu. I'll begin by clicking on the Widgets link in the Appearance menu: On this page, look for the Weaver II Per Page Text widget. Click on and drag it into the primary sidebar under the search bar widget that is already in place. The widget is shown above. You may notice the instructions that come along with it. It says we need to create Custom Fields to specify this widget on each page. Now we will go back through each page of the site, except for the home page, and edit it. On each page, scroll down towards the bottom and look for the box titled Custom Fields. The bottom part of this box allows you to add a new custom field. We need to create two here. If the names of the fields are not already in the drop-down box provided, click on the Enter New link to get a blank text box that allows you to specify your own field name. The first field we want to create needs this name: wvr_pp_title The value of the field will be the title used on the public site for this particular menu. I'll just use the words “Buying Guide” for this because the page I am editing is one of the buying guide pages. The next field should be named this: wvr_pp_text The value of this field should be one of the shortcodes from the Shortcode Menu plugin. Just pick the appropriate shortcode from your Notepad file and paste it in here. You can see what I have input below for this particular page. All I need to do now is click the Add Custom Field button to save this last field, and then click on the Update button to save the changes to the page. If I visit this page on the live site, I can now see my custom menu show up in the sidebar. Simply repeat this process on all of the pages, except the home page, to have a custom menu in the sidebar of every page that will link to the other relational pages in the same category on your site. Next Azon Master Class © Site Construction 2/2 >>> Back to TABLE OF CONTENTS <<< | |
Views: 1543 | |
Total comments: 0 | |