are you working with a child theme?
if yes, create a folder /template-parts/ in the child theme, add a new file sidebar-page.php (the name is important as it is referred to in the functions).
code for the sidebar-page.php file:
<?php
/**
Template Name: Sidebar Page
*/
get_header(); ?>
<div class="wrap">
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php
while ( have_posts() ) : the_post();
get_template_part( 'template-parts/page/content', 'page' );
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
endwhile; // End of the loop.
?>
</main><!-- #main -->
</div><!-- #primary -->
<?php get_sidebar(); ?>
</div><!-- .wrap -->
<?php get_footer();
in functions.php of the child theme, add:
add_filter( 'body_class', 'sidebar_page_body_classes', 12 );
function sidebar_page_body_classes( $classes ) {
if ( is_page_template( 'template-parts/sidebar-page.php' ) ) {
if( in_array('page-two-column', $classes) ) {
unset( $classes[array_search('page-two-column', $classes)] );
$classes[] = 'page-one-column';
}
$classes[] = 'has-sidebar';
}
return $classes;
}
you can then select the new page template under page attributes when creating or editing a page.