Using an alternative sidebar when creating a WordPress theme

I’m trying to figure out how to load an alternative sidebar in a WordPress theme I’m creating (I’m a novice, by the way). A very old answer on stackoverflow suggests creating a new sidebar and calling it something like sidebar_alt.php and altering the code as follows:

<?php get_sidebar('alt'); ?>

But that doesn’t work for me, it just keeps loading the original sidebar. I read a different answer that said you have to register the alternative sidebar in the functions.php file. Do any of you very nice, smart and helpful people out there know if this is true? If so, what code would I have to add? Or is there another alternative (that doesn’t include plugins)?

Read More

Many thanks in advance.

Related posts

1 comment

Comments are closed.