0

So, where is the searchresult page sidebar located?

For example, in the searchresult page, there is "A" sidebar.

However, I want to change it to "B" sidebar.

I looked at search.php but could not understand where the sidebar was coming from.

0

Your search.php may contain the following code

<?php get_sidebar(); ?>

If a name ($name) is specified as an argument then a specialized sidebar sidebar-{name}.php will be included. If sidebar-{name}.php does not exist, then it will fallback to loading sidebar.php.

If the theme contains no sidebar.php file then the sidebar from the default theme will be included

| improve this answer | |
-1

You can create a new sidebar with name sidebar-search.php and call it on search.php page using

<?php get_sidebar('search'); ?>
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.