Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save danieljwonder/04d16d994bc7c0a62e9bd9d6bba2e990 to your computer and use it in GitHub Desktop.
Save danieljwonder/04d16d994bc7c0a62e9bd9d6bba2e990 to your computer and use it in GitHub Desktop.

Revisions

  1. @AlphaBlossom AlphaBlossom revised this gist Nov 23, 2015. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions woocommerce-genesis-theme-support.php
    Original file line number Diff line number Diff line change
    @@ -13,8 +13,8 @@
    *
    **********************************/

    // Add WooCommerce support for Genesis layouts (sidebar, full-width, etc) - Thank you Kelly Murray
    add_post_type_support( 'product', 'genesis-layouts' );
    // Add WooCommerce support for Genesis layouts (sidebar, full-width, etc) - Thank you Kelly Murray/David Wang
    add_post_type_support( 'product', array( 'genesis-layouts', 'genesis-seo' ) );

    // Unhook WooCommerce Sidebar - use Genesis Sidebars instead
    remove_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar', 10 );
  2. @AlphaBlossom AlphaBlossom revised this gist Apr 4, 2015. 4 changed files with 16 additions and 18 deletions.
    2 changes: 1 addition & 1 deletion remove-woocommerce-admin-theme-support-warning.php
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,2 @@
    /* Remove WooCommerce Theme Support admin message */
    // Remove WooCommerce Theme Support admin message
    add_theme_support( 'woocommerce' );
    6 changes: 1 addition & 5 deletions replace-genesis-breadcrumbs-woocommerce.php
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,4 @@
    /*
    *
    * Remove Genesis breadcrumbs, using Woocommerce crumbs instead.
    *
    */
    // Remove Genesis breadcrumbs, using Woocommerce crumbs instead.
    add_action( 'get_header', 'youruniqueprefix_remove_wc_breadcrumbs' );
    function youruniqueprefix_remove_wc_breadcrumbs() {

    6 changes: 1 addition & 5 deletions replace-woocommerce-breadcrumbs-genesis.php
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,4 @@
    /*
    *
    * Remove WooCommerce breadcrumbs, using Genesis crumbs instead.
    *
    */
    // Remove WooCommerce breadcrumbs, using Genesis crumbs instead.
    add_action( 'get_header', 'youruniqueprefix_remove_wc_breadcrumbs' );
    function youruniqueprefix_remove_wc_breadcrumbs() {

    20 changes: 13 additions & 7 deletions woocommerce-genesis-theme-support.php
    Original file line number Diff line number Diff line change
    @@ -13,15 +13,21 @@
    *
    **********************************/

    /* Unhook WooCommerce wrappers */
    remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10);
    remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10);
    // Add WooCommerce support for Genesis layouts (sidebar, full-width, etc) - Thank you Kelly Murray
    add_post_type_support( 'product', 'genesis-layouts' );

    /* Hook new functions with Genesis wrappers */
    add_action('woocommerce_before_main_content', 'youruniqueprefix_my_theme_wrapper_start', 10);
    add_action('woocommerce_after_main_content', 'youruniqueprefix_my_theme_wrapper_end', 10);
    // Unhook WooCommerce Sidebar - use Genesis Sidebars instead
    remove_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar', 10 );

    /* Add opening wrapper before WooCommerce loop */
    // Unhook WooCommerce wrappers
    remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10 );
    remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10 );

    // Hook new functions with Genesis wrappers
    add_action( 'woocommerce_before_main_content', 'youruniqueprefix_my_theme_wrapper_start', 10 );
    add_action( 'woocommerce_after_main_content', 'youruniqueprefix_my_theme_wrapper_end', 10 );

    // Add opening wrapper before WooCommerce loop
    function youruniqueprefix_my_theme_wrapper_start() {

    do_action( 'genesis_before_content_sidebar_wrap' );
  3. @AlphaBlossom AlphaBlossom revised this gist Jun 27, 2014. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions woocommerce-genesis-theme-support.php
    Original file line number Diff line number Diff line change
    @@ -39,10 +39,10 @@ function youruniqueprefix_my_theme_wrapper_start() {
    ) );
    do_action( 'genesis_before_loop' );

    }
    }

    /* Add closing wrapper after WooCommerce loop */
    function youruniqueprefix_my_theme_wrapper_end() {
    /* Add closing wrapper after WooCommerce loop */
    function youruniqueprefix_my_theme_wrapper_end() {

    do_action( 'genesis_after_loop' );
    genesis_markup( array(
  4. @AlphaBlossom AlphaBlossom created this gist Jun 27, 2014.
    2 changes: 2 additions & 0 deletions remove-woocommerce-admin-theme-support-warning.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    /* Remove WooCommerce Theme Support admin message */
    add_theme_support( 'woocommerce' );
    11 changes: 11 additions & 0 deletions replace-genesis-breadcrumbs-woocommerce.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    /*
    *
    * Remove Genesis breadcrumbs, using Woocommerce crumbs instead.
    *
    */
    add_action( 'get_header', 'youruniqueprefix_remove_wc_breadcrumbs' );
    function youruniqueprefix_remove_wc_breadcrumbs() {

    remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );

    }
    11 changes: 11 additions & 0 deletions replace-woocommerce-breadcrumbs-genesis.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    /*
    *
    * Remove WooCommerce breadcrumbs, using Genesis crumbs instead.
    *
    */
    add_action( 'get_header', 'youruniqueprefix_remove_wc_breadcrumbs' );
    function youruniqueprefix_remove_wc_breadcrumbs() {

    remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0 );

    }
    57 changes: 57 additions & 0 deletions woocommerce-genesis-theme-support.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,57 @@
    /**********************************
    *
    * Integrate WooCommerce with Genesis.
    *
    * Unhook WooCommerce wrappers and
    * Replace with Genesis wrappers.
    *
    * Reference Genesis file:
    * genesis/lib/framework.php
    *
    * @author AlphaBlossom / Tony Eppright
    * @link http://www.alphablossom.com
    *
    **********************************/

    /* Unhook WooCommerce wrappers */
    remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10);
    remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10);

    /* Hook new functions with Genesis wrappers */
    add_action('woocommerce_before_main_content', 'youruniqueprefix_my_theme_wrapper_start', 10);
    add_action('woocommerce_after_main_content', 'youruniqueprefix_my_theme_wrapper_end', 10);

    /* Add opening wrapper before WooCommerce loop */
    function youruniqueprefix_my_theme_wrapper_start() {

    do_action( 'genesis_before_content_sidebar_wrap' );
    genesis_markup( array(
    'html5' => '<div %s>',
    'xhtml' => '<div id="content-sidebar-wrap">',
    'context' => 'content-sidebar-wrap',
    ) );

    do_action( 'genesis_before_content' );
    genesis_markup( array(
    'html5' => '<main %s>',
    'xhtml' => '<div id="content" class="hfeed">',
    'context' => 'content',
    ) );
    do_action( 'genesis_before_loop' );

    }

    /* Add closing wrapper after WooCommerce loop */
    function youruniqueprefix_my_theme_wrapper_end() {

    do_action( 'genesis_after_loop' );
    genesis_markup( array(
    'html5' => '</main>', //* end .content
    'xhtml' => '</div>', //* end #content
    ) );
    do_action( 'genesis_after_content' );

    echo '</div>'; //* end .content-sidebar-wrap or #content-sidebar-wrap
    do_action( 'genesis_after_content_sidebar_wrap' );

    }