No-follow code problem
-
I have tried several things. I need to have the images open to an external website in a new tab (window). Also, I need to make sure all external links of affiliates will have nofollow so that my SEO is not affected.
Here is the code that works, however, it will not open in a new tab, and I don’t know how to put a no follow code in here.
Any help would be greatly appreciated!
add_action('template_redirect', 'redirect_external_products'); function redirect_external_products() { global $post; if (is_singular( 'product' ) && ! empty( $post ) && ($product = wc_get_product($post)) && $product->is_type('external' )) { wp_redirect( $product->get_product_url() ); exit; } }
The page I need help with: [log in to see the link]
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘No-follow code problem’ is closed to new replies.