My Wordpress theme is using some code in the "sidebar.php" file that tells it that some pages should always use the default sidebar. This was fine until I found that each and every custom taxonomy (example: "taxonomy-mountains.php") page is defaulting to this default sidebar.
I thought about catching this with is_taxonomy(), but that's deprecated and won't work. Any better programmers out there with an idea of how I could fix this now. Something like if(is_taxonomy('mountains')){} would've worked fine. Below code is an excerpt, if you think something is missing let me know.
//Default sidebar
$selected_sidebar_replacement = 'Sidebar Widgets';
//If is page or single
if(is_singular()){
global $wp_query;
$post = $wp_query->get_queried_object();
$selected_sidebar_replacement = get_post_meta($post->ID, 'sbg_selected_sidebar_replacement', true);
//If default selected
if($selected_sidebar_replacement == '0' || $selected_sidebar_replacement == ''){
$selected_sidebar_replacement = 'Sidebar Widgets';
}
// Reset the global $the_post
wp_reset_query();
}