In a default install of most Genesis child themes, the entire site utilizes the same set of widgets in the sidebar for every page that displays a sidebar – but what if you want to show different widgets on different page types? Say, for example, you want to display images from your portfolio categories on individual portfolio pages, or custom menus for different service offerings on your services page. You could install a plugin to add this functionality, but you could just as easily add the specific change you want to your theme files by adding the following code snippet to your functions.php
file and your page-custom.php
file. Just remember to change “custom” to some unique identifier in this code (i.e. “favorite-things-sidebar”, “Favorite Things Sidebar”, and “page-favorite-things.php”)
Remember: Editing your live site via the code editor is discouraged. Test out any changes on a local copy of your site first (see this tutorial if you don’t know how) before uploading the updated files to your live site.
Leave a Reply