How can we help?

If you are looking for support for our PokaTheme, this is the place!

Home Forums PokaTheme support Disable affiliate link

  • This topic has 3 replies, 2 voices, and was last updated 1 year ago by admin.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #17728
    Fabien Cavanna
    Participant

    Hi,

    Is there a way to disable affiliate link function or to be able to use a link without redirect ?

    Thanks.

    #17738
    admin
    Keymaster

    Hi Fabien,

    1. You can completely remove the affiliate link button using the following code snippet. You can add this to your child theme’s functions.php.

    add_filter( 'poka_affiliate_button', '__return_false' );
    

    2. You can use the affiliate link button without the redirect by overwriting the “poka_affiliate_link” function. You can do this by pasting the above inside your child theme’s functions.php.

    function poka_affiliate_link( $review_id ) {
    	$base = get_theme_mod( 'general-affiliate-redirect-link-folder' ) ? get_theme_mod( 'general-affiliate-redirect-link-folder' ) : 'go';
    
    	if ( '' !== $review_id ) {
    		$affiliate_link_id = poka_get_field( 'affiliate_link', $review_id );
    		$link              = poka_get_field( 'affiliate_link', $affiliate_link_id );
    	} else {
    		$link = '#';
    	}
    
    	return apply_filters( 'poka_affiliate_link', $link );
    }
    
    #17741
    Fabien Cavanna
    Participant

    Thanks, that works perfectly.

    #17742
    admin
    Keymaster

    You’re welcome!

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.