add_filter('the_content', 'ghq_auto_amazon_button');function ghq_auto_amazon_button($content) { if (is_single()) {// Example ASIN (you can make dynamic later) $asin = "B09ZWKD9TF";$button = do_shortcode('[ghq_amazon_button asin="'.$asin.'" text="Check Price on Amazon"]');return $content . $button; } return $content; }add_filter('the_content', 'ghq_auto_affiliate_box');function ghq_auto_affiliate_box($content) { if (is_single()) {$box = '
✔ Fast Amazon Prime Shipping
✔ Trusted Reviews from Thousands of Gamers
✔ Limited-Time Discounts Available
🔥 Trending now — limited availability!
';return $box . $content; }return $content; } add_filter('the_content', function($content){ $tag = defined('GHQ_AMAZON_TAG') ? GHQ_AMAZON_TAG : 'Gamesherehq00-20';return preg_replace_callback('#https?://(www\.)?amazon\.com/[^"\s<]+#i', function($m) use ($tag){ $url = $m[0];// replace any existing tag with yours if (stripos($url,'tag=') !== false) { $url = preg_replace('/([?&])tag=[^&]+/i', '$1tag=' . rawurlencode($tag), $url); return $url; }// otherwise append your tag $sep = (strpos($url,'?') !== false) ? '&' : '?'; return $url . $sep . 'tag=' . rawurlencode($tag); }, $content); }, 60);
View all
As an Amazon Associate, GamesHereHQ earns from qualifying purchases.
function ghq_price_box_shortcode($atts) { $atts = shortcode_atts(array( 'asin' => '', 'btn_text' => 'Check Price on Amazon' ), $atts);$asin = esc_attr($atts['asin']); $btn_text = esc_html($atts['btn_text']); $affiliate_id = 'Gamesherehq-20'; $link = "https://www.amazon.com/dp/$asin?tag=$affiliate_id"; return ''; add_shortcode('ghq_price_box', 'ghq_price_box_shortcode');