jaredatch / Shared-Counts

WordPress plugin that leverages SharedCount.com API to quickly retrieve, cache, and display various social sharing counts.
GNU General Public License v2.0
47 stars 16 forks source link

Doesn’t display on WooCommerce products if using a Genesis theme #114

Closed ZeroGravityWeb closed 3 years ago

ZeroGravityWeb commented 3 years ago

Plugin version 1.3.0

If you are using a Genesis theme the plugin uses the genesis_entry_header and genesis_entry_footer actions. I gather these are not fired when the page is a WooCommerce product so the sharing icons are not displayed

I’m sure there is probably a better way to do this but I added the following code to the theme_location() function at line #54 in class-shared-counts-front.php. ` // WooCommerce Hooks. if ( is_woocommerce() ) {

$locations = [
    'before' => [
        'hook'     => 'woocommerce_before_single_product',
        'filter'   => false,
        'priority' => 13,
        'style'    => false,
    ],
    'after'  => [
        'hook'     => 'woocommerce_after_single_product',
        'filter'   => false,
        'priority' => 8,
        'style'    => false,
    ],
];

// Genesis Hooks. } elseif ( 'genesis' === get_template() ) { `

ZeroGravityWeb commented 3 years ago

I should have kept reading. I just found the tutorial on shared_counts_theme_locations filter. Sorry.