One possiblilty:
Keep the new code in sidebar.php in your child theme.
In blog-page.php, change the line get_sidebar('blog-sidebar');
to do_action( 'storefront_sidebar' );
(as in an original page.php).
Tested in a blog-page.php page template without custom query and loop, and also no woocommerce installed, this should work.
If not, the custom query and loop might interfere. in this case, please post the full code of blog-page.php.
ALTERNATIVELY, keep your code in blog-page.php, and keep the original (parent theme) code in sidebar.php.
Create a new file sidebar-blog-sidebar.php based on following code:
if ( ! is_active_sidebar( 'blog-sidebar' ) ) {
return;
}
?>
<div id="secondary" class="widget-area" role="complementary">
<?php dynamic_sidebar( 'blog-sidebar' ); ?>
</div><!-- #secondary -->
Related Posts:
- Register/Get sidebar?
- Add #sidebar-2 to a custom page template
- Custom page template to sidebar/widget
- E-Commerce Products Page Sidebar Formatting
- Showing sidebar-2 on custom template page
- How To Create A Paginated List Of All Categories On My Site?
- Password protected posts redirects
- Variable use in get_template_part
- Overriding page template using page_template filter
- Loading page content into a variable in template
- Capturing arbitrary semantic URL arguments
- How do I display the text inside the WP editor for a page with a custom template?
- Dynamically assign same page template to child page as parent
- What content should go in index.php?
- How to pass a numeric id to a page template?
- How can I dynamically load another page template to provide an alternate layout of the posts?
- Create a new template for twentytwelve
- get url page template
- Posts archive index pagination in a static page custom query
- How to Set a Custom Template for Blog Posts
- How can I have a static title on my blog page?
- Use is_category(), is_tag(), … in functions.php
- How do I add a body class to specific pages?
- How to list all titles of posts on a specific page?
- How to handle a missing page.php?
- Customize edit.php Pages listing in dashboard to show only pages with a particular template applied?
- Programatically switch page template?
- remove page template from dropdown?
- Export csv and force download in template page
- WPML in custom page templates
- Why (and how?) is get_header() erasing all my stuff?
- get_pages — parent vs child_of?
- Display a specific dynamic sidebar widgets on a specific page
- How to pass outside function to WP_REST_Request
- page.php not displaying content
- WP-CLI not setting page template with page_template=”template-name.php”
- Create a page template with No Footer
- Only show content if current page is NOT one of 2 page templates [closed]
- Custom page sidebar using Template dropdown box
- How to make text show up – new page template
- using the loop with a custom table
- Verify if the current page has at least one published child
- how to remove all body classes in wordpress
- Custom Post Type Archive template page not found
- What is wrong with my page.php?
- wp_redirect goes to infinity loop
- Single page Template for pages that begin with ‘confirmation-‘
- What content to use for inserting images
- Display one post in different formats conditionally
- Want to exclude slider from page.php in header
- get_avatar() as backround image
- get_the_excerpt() inside WP_Query – link URL Incorrect
- Change text size and color for tags and category meta description on product page
- Strip from the_tags() output
- How to make Dynamic Page Template based on Post ID’s
- add_rewrite_rule no longer working – possible https issue?
- Template Tag Does Not Work in Page Template
- Contact template doesnt appear in page template options
- Does get_template_part() content gets parsed if it’s not executed?
- How to set custom cookies in WordPress after a form is filled on a page
- Proper way to create custom static page
- How can I correctly redirect user to the submitted post and define a template for each new post in WordPress?
- How to display all child/sub pages from all parent pages?
- RSS feed for a custom page template
- WordPress page template to show posts as per category dynamically
- How to edit woocommerce sub-category page
- page.php template file render a core gutenberg component programmatically
- Subpage is redirecting to spam site
- How to integrate custom HTML template in a premium wordpress theme?
- How to load page template according to the Searched Page
- Set page template automatically according to parent slug
- How to display the contents of URL1 when user visits URL2
- How to require specific PHP files for specific templates
- Static page won’t identify template
- Restrict Access to Logged-In Users Page Template
- Is there a universal slug for static homepage?
- What is the best way to manage pages content?
- Add additional templates to the templates drop down on add page menu [duplicate]
- Page Template CSS file not loading
- Custom templates stopped working
- .htaccess help to a beginner
- Decision about page templates for static pages
- Single page theme: Can I render other pages with their respective themes within another page?
- Special 404 header page
- change the Theme dynamically
- How can I set full width page layout in a default post page?
- Lead Generation with Cookies in WordPress
- Recents posts pulling from different post type
- trying to add custom landing page to Twenty Eleven- can’t get rid of Twenty Eleven header/container? [duplicate]
- Template tag for /page/# structure
- Fetching Image from other post/page with custom type
- wordpress header leaks into body in a specific template
- Display child page on parent
- Utilizing the template hierarchy while storing page templates in a subdirectory
- Add a title to ACF form from frontend
- Show page name in browser
- How do I create a page template that doesn’t show URL, sidebar, nav menu, footer?
- Animation as shown in the link
- Custom page template not working on mobile
- Extra HTML code added to my (on Chrome DevTools) but not on source code