Skip to content

Instantly share code, notes, and snippets.

@DevinVinson
Created February 28, 2014 06:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DevinVinson/9266284 to your computer and use it in GitHub Desktop.
Save DevinVinson/9266284 to your computer and use it in GitHub Desktop.
Change single product page to have right sidebar
#
# wrap single product image in an extra div
#
add_action( 'woocommerce_before_single_product_summary', 'avia_add_image_div', 2);
add_action( 'woocommerce_before_single_product_summary', 'avia_close_image_div', 20);
function avia_add_image_div()
{
echo "<div class='four units single-product-main-image alpha'>";
}
function avia_close_image_div()
{
global $avia_config;
$avia_config['currently_viewing'] = "shop_single";
echo "</div>";
}
#
# wrap single product summary in an extra div
#
add_action( 'woocommerce_before_single_product_summary', 'avia_add_summary_div', 25);
add_action( 'woocommerce_after_single_product_summary', 'avia_close_summary_div', 3);
function avia_add_summary_div()
{
echo "<div class='five units single-product-summary'>";
}
function avia_close_summary_div()
{
echo "</div>"; //close out the summary
echo "<div class='three units single-product-sidebar'>";
get_sidebar();
echo "</div>";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment