[resolved] Third party / custom theme compatibility (3 posts)

  1. albertorrent
    Posted 4 years ago #

    I want to use WooCommerce plugin with my theme, but I have some layouts problems.

    I used that guide but I don't know properly to fix it.

    Fixing the layout

    On the most part, WooCommerce templates will integrate nicely with most WordPress themes. Where you may run into problems is when the default WooCommerce content wrappers do not match your chosen theme’s. This will manifest itself by breaking your layout on WooCommerce pages and shifting your sidebars into incorrect positions. There are two ways to fix this; using WooCommerce hooks (resulting in maximum flexibility) or, since 1.4 using our catch-all woocommerce_content() function (less flexible).

    Using woocommerce_content() (1.4+)

    If you’re using 1.4 there’s an option to create a new template within your theme which will be used for all WooCommerce content. While an easy catch-all solution, it does have a draw back in that this template will be used for all WooCommerce pages. Product categories, user accounts, cart, checkout, everything. “Short-cuts lead to long delays” – you’ve been warned!

    The easiest way to implement this is to copy/paste page.php within your theme, rename it was woocommerce.php and replace the standard page loop with <?php woocommerce_content(); ?>. Upload and you’re done!

    Using hooks

    First unhook the 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);

    Then hook in your own;
    add_action('woocommerce_before_main_content', create_function('', 'echo "<section id=\"main\">";'), 10);

    add_action('woocommerce_after_main_content', create_function('', 'echo "</section>";'), 10);

    Making sure that the markup matches that of your theme. If you’re unsure of which classes or ID’s to use take a look at page.php for a guide.


    ///END GUIDE///

    I tried the Using woocommerce_content() (1.4+) metod but.. nothing.

    My site
    Using theme "Hermes"

    I can give my wp-admin access, can someone helpme please?



  2. bensontrent
    Posted 4 years ago #

    Thank you! This really helped me out after LOTS of searching. Woocommerce docs are generally unhelpful and unsearchable. I used the <?php woocommerce_content(); ?> method in a custom page template. Woocommerce custom theme integration should be better documented!

  3. Mike Jolley
    Plugin Author

    Posted 4 years ago #

    Codex > Theming > Third party theme compatibility. http://wcdocs.woothemes.com/codex/third-party-custom-theme-compatibility/

    I don't think thats too difficult to find :) Search could be better though.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic