Skip to content

Instantly share code, notes, and snippets.

View alewolf's full-sized avatar

Aleksandar alewolf

View GitHub Profile
<?php
/**
* Track custom add-to-cart conversions using the WooCommerce Pixel Manager
*
* Add this to your functions.php file
*/
add_action('wp_footer', function () {
?>
<?php
/**
* If you want to fire the ViewItem event on variable products when
* no variation has been selected yet, then use the following code in
* your functions.php file.
*/
add_action('wp_footer', function () {
?>
<script>
RENAME TABLE
wp_actionscheduler_logs TO custom_prefix_actionscheduler_logs,
wp_actionscheduler_groups TO custom_prefix_actionscheduler_groups,
wp_actionscheduler_claims TO custom_prefix_actionscheduler_claims,
wp_actionscheduler_actions TO custom_prefix_actionscheduler_actions
<?php
/**
* This mu plugin deactivates the Pixel Manager
* while the Thrive Theme editor is active.
*
* Create a file disable-pmw-on-thrive-editor.php.
* Place it in the /mu-plugins/ folder within the /wp-content/ folder.
* If the /mu-plugins/ folder doesn't exist yet, it must be manually created.
*/
@alewolf
alewolf / gads-id-for-wc-google-listing-ads.php
Last active May 19, 2023 07:57
Enable product ID output for woopt Pixel Manager Google Ads dynamic remarketing for the WooCommerce Google Listing and Ads plugin
<?php
// Place the following code into your functions.php file in your child theme
add_filter('wooptpm_product_ids', function ($product_ids, $product) {
$product_ids['gla'] = 'gla_' . $product->get_id();
return $product_ids;
}, 10, 2);
@alewolf
alewolf / search-results.php
Last active May 30, 2023 23:45
SearchWP Live Ajax Search results with thumbnails
<?php
/**
* This template adds thumbnails to your SearchWP Live Ajax Search results.
*
* Create a folder called searchwp-live-ajax-search in your child theme folder and copy this file in there.
* In order for this to work you require the SearchWP and SearchWP Live Ajax Search plugins installed and active.
*
*/
?>