Title: adding CLASS to Amazon Textlink
Last modified: August 22, 2016

---

# adding CLASS to Amazon Textlink

 *  Resolved [Micha – MS29](https://wordpress.org/support/users/fotoglut/)
 * (@fotoglut)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/adding-class-to-amazon-textlink/)
 * Hi,
 * the toppic say it all 🙂
    I will add an CLASS to the Textlink (Update sure).
 * See [here](https://www.fotoglut.de/2014/haematom-video-bilder-im-kopf/) the First
   Link (Bilder im Kopf) is generatet with your Plugin, the second (under the Video)
   is an normal Textlink.
    I have an plugin that indicates the external Links like
   the second one. But with your script it doenst work, so i will put the CLASS 
   to the Link direkt.
 * Thanks for your Help
 * [https://wordpress.org/plugins/amazon-link/](https://wordpress.org/plugins/amazon-link/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [paulstuttard](https://wordpress.org/support/users/paulstuttard/)
 * (@paulstuttard)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/adding-class-to-amazon-textlink/#post-5420939)
 * Hi,
 * Try adding this code somewhere in your site (functions.php, or at the end of 
   the plugin php file):
 *     ```
       function alx_extras_add_link_class ($url){
            $url = str_replace('rel=', 'class="my_class" rel=', $url);
            return $url;
         }
         add_filter( 'amazon_link_template_get_link_open',  'alx_extras_add_link_class', 22, 1 );
         add_filter( 'amazon_link_template_get_rlink_open', 'alx_extras_add_link_class', 22, 1 );
         add_filter( 'amazon_link_template_get_slink_open', 'alx_extras_add_link_class', 22, 1 );
       ```
   
 * Change `my_class` to the appropriate class.
 * Paul

Viewing 1 replies (of 1 total)

The topic ‘adding CLASS to Amazon Textlink’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/amazon-link_070606.svg)
 * [Amazon Link](https://wordpress.org/plugins/amazon-link/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/amazon-link/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/amazon-link/)
 * [Active Topics](https://wordpress.org/support/plugin/amazon-link/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/amazon-link/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/amazon-link/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [paulstuttard](https://wordpress.org/support/users/paulstuttard/)
 * Last activity: [11 years, 7 months ago](https://wordpress.org/support/topic/adding-class-to-amazon-textlink/#post-5420939)
 * Status: resolved