• Hi

    I found https://wcdocs.woothemes.com/codex/third-party-custom-theme-compatibility/

    And frankly I don’t understand it.

    The hook method is more involved that using woocommerce_content, but is more flexible. This is similar to the method we use when creating our themes. It’s also the method we use to integrate nicely with Twenty Ten and Eleven.

    By inserting a few lines in your theme’s functions.php file, First unhook the WooCommerce wrappers;

    1.remove_action( ‘woocommerce_before_main_content’, ‘woocommerce_output_content_wrapper’, 10);
    2.remove_action( ‘woocommerce_after_main_content’, ‘woocommerce_output_content_wrapper_end’, 10);

    Then hook in your own functions to display the wrappers your theme requires;

    add_action(‘woocommerce_before_main_content’, ‘my_theme_wrapper_start’, 10);
    add_action(‘woocommerce_after_main_content’, ‘my_theme_wrapper_end’, 10);

    function my_theme_wrapper_start() {
    echo ‘<section id=”main”>’;
    }

    function my_theme_wrapper_end() {
    echo ‘</section>’;
    }

    Make 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 your theme’s page.php for a guide.

    I’ve tried adding this to lines 1. onward in the function.php file and nothing happens?

    Please help.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter acknowledged74

    (@acknowledged74)

    function.php start with

    1. <?php
    /**
    * @package WordPress
    * @subpackage Arapah-WP
    */

    /*
    * Loads the Options Panel

    I’ve tried it before and after the <?php but literally nothing happens ?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    You can receive urgent support here https://jobs.wordpress.net

    Thread Starter acknowledged74

    (@acknowledged74)

    The top section of my page.php is as follows;

    <section id=”maincontent”>
    <div class=”container”>
    <div class=”two-thirds column”>
    <div class=”gutter alpha”>
    <section id=”primary” class=”main”>
    <div id=”content”>

    Where the hook instructions say –
    function my_theme_wrapper_start() {
    echo ‘<section id=”main”>’;
    }

    I don’t understand what I need to change ‘my_theme_wrapper_start’ or id=”main” or both and to what?

    Any advice would be great much appreciated?

    Thread Starter acknowledged74

    (@acknowledged74)

    I have tried the woocommerce_content() by the way, which works fine but just doesn’t provide the functionality I require, so I need to work out the Hook.

    Thread Starter acknowledged74

    (@acknowledged74)

    I’ve put

    add_action(‘woocommerce_before_main_content’, ‘my_theme_wrapper_start’, 10);
    add_action(‘woocommerce_after_main_content’, ‘my_theme_wrapper_end’, 10);

    function my_theme_wrapper_start() {
    echo ‘<section id=”maincontent”>’;
    }

    function my_theme_wrapper_end() {
    echo ‘</section>’;
    }

    into my function.php and literally nothing has happened.

    I am actually sitting here getting angry now, wasting my swearword expletive time.

    Woo say contact support but you can’t until you have purchased an extension, but if this won’t work with my theme I’m not going to buy an extension, complete catch 22 and the instructions,

    ” By inserting a few lines in your theme’s functions.php file, First unhook the WooCommerce wrappers;

    1.remove_action( ‘woocommerce_before_main_content’, ‘woocommerce_output_content_wrapper’, 10);
    2.remove_action( ‘woocommerce_after_main_content’, ‘woocommerce_output_content_wrapper_end’, 10); “

    just doesn’t even make sense – comma capital letter what the hell.

    argggggggggggggggggggggggggggggggggggggggggggggggggghhh WordPress is such a pain.

    Thread Starter acknowledged74

    (@acknowledged74)

    Would someone please take the time to help with this, hopefully someone from Woo.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: Woocommerce] Not sure about this Hook thing, to intergrate with theme’ is closed to new replies.