Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save omurphy27/5913ae21b1637f8129d2 to your computer and use it in GitHub Desktop.
Save omurphy27/5913ae21b1637f8129d2 to your computer and use it in GitHub Desktop.
WooCommerce - Change Wrapping Markup through Main Content Action Hook.php
<?php
// add core markup to woocommerce pages
add_action('woocommerce_before_main_content', 'woocommerce_output_content_wrapper');
// overwrite existing output content wrapper function
function woocommerce_output_content_wrapper() {
echo '<div class="main-bg no-top-banner">
<div class="container">
<div id="content" class="row" >
<div id="main" class="col-md-9 pull-right clearfix" >';
}
add_action('woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end');
function woocommerce_output_content_wrapper_end() {
echo '</div><!-- Close Main -->
</div><!-- Close Row -->
</div><!-- Close Container -->
</div><!-- Close Main-BG -->';
}
@Flipmediaco
Copy link

Consider adding the following to include checkout:-

add_action('woocommerce_before_checkout_form', 'woocommerce_output_content_wrapper');
add_action('woocommerce_after_checkout_form', 'woocommerce_output_content_wrapper_end');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment