Title: Filter for link class
Last modified: August 31, 2016

---

# Filter for link class

 *  Resolved [ninetienne](https://wordpress.org/support/users/ninetienne/)
 * (@ninetienne)
 * [10 years ago](https://wordpress.org/support/topic/filter-for-link-class/)
 * Could you please add a filter for the class of `<a>` instead of the wrapping `
   <p>`? All classes are usually applied on anchors directly, i.e. `.btn`, etc and
   not on wrapping paragraphs or divs.
 * Thanks.
 * [https://wordpress.org/plugins/wp-instagram-widget/](https://wordpress.org/plugins/wp-instagram-widget/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Scott (@scottsweb)](https://wordpress.org/support/users/scottsweb/)
 * (@scottsweb)
 * [10 years ago](https://wordpress.org/support/topic/filter-for-link-class/#post-7316015)
 * In version 1.4 and above you can also customise the image loop completely by 
   creating a parts/wp-instagram-widget.php file in your theme. This will allow 
   you to add custom classes to everything.
 * See [https://github.com/scottsweb/wp-instagram-widget/blob/master/wp-instagram-widget.php#L100-L104](https://github.com/scottsweb/wp-instagram-widget/blob/master/wp-instagram-widget.php#L100-L104)
 * If you wish to customise the Instagram link you could target it with
 * `p.custom_class a {}`
 * If you are using a CSS pre-processor you could easily add the same button styles
   as a mixin:
 * `p.custom_class a { @include .btn() }`
 *  Plugin Author [Scott (@scottsweb)](https://wordpress.org/support/users/scottsweb/)
 * (@scottsweb)
 * [10 years ago](https://wordpress.org/support/topic/filter-for-link-class/#post-7316016)
 * Pull requests are also welcome: [https://github.com/scottsweb/wp-instagram-widget](https://github.com/scottsweb/wp-instagram-widget)
 *  Thread Starter [ninetienne](https://wordpress.org/support/users/ninetienne/)
 * (@ninetienne)
 * [10 years ago](https://wordpress.org/support/topic/filter-for-link-class/#post-7316040)
 * Thanks for a quick reply!
 * I know that you may use a custom template for the image loop. I’m using it to
   add number of likes and comments.
 * I also know that you can target the link via targeting the anchor inside paragraph.
   But it looks like going from New York to Los Angeles via Paris.
 * I’m using SASS and there’s no easy mixin for a `btn` in Bootstrap. You may `extend`
   but it will result in extra code.
 * In general your filter is called `wpiw_link_class`, not `wpiw_clear_class` or`
   wpiw_paragraph_class`, so I think it would be much more convenient to add the
   class to `<a>` rather than `<p>`.
 * Moreover there’s a mixin for `clearfix` in Bootstrap 😉
 * I would submit a pull request, but I’m a git newbie.
 * Would be more than happy if you could change the filter or add a new one.
 * Thanks a lot for the great plugin anyway!
 *  Plugin Author [Scott (@scottsweb)](https://wordpress.org/support/users/scottsweb/)
 * (@scottsweb)
 * [10 years ago](https://wordpress.org/support/topic/filter-for-link-class/#post-7316042)
 * > I’m using SASS and there’s no easy mixin for a btn in Bootstrap.
 * I think there is, you can see it in use here: [https://github.com/twbs/bootstrap/blob/v4-dev/scss/_buttons.scss#L63](https://github.com/twbs/bootstrap/blob/v4-dev/scss/_buttons.scss#L63)
 * I will consider getting this added in future but will not move the existing filter
   as that would be a breaking change: [https://github.com/scottsweb/wp-instagram-widget/issues/48](https://github.com/scottsweb/wp-instagram-widget/issues/48)
 *  Thread Starter [ninetienne](https://wordpress.org/support/users/ninetienne/)
 * (@ninetienne)
 * [10 years ago](https://wordpress.org/support/topic/filter-for-link-class/#post-7316061)
 * > I think there is, you can see it in use here: [https://github.com/twbs/bootstrap/blob/v4-dev/scss/_buttons.scss#L63](https://github.com/twbs/bootstrap/blob/v4-dev/scss/_buttons.scss#L63)
 * It’s actually button varient only, i.e. color and background color. It doesn’t
   add any paddings or font styles. So I would have to add it myself, repeating 
   the same code and losing consistency.
 * Don’t think a lot of people using the filter. Sometimes breaking changes are 
   inavoidable. However to be on the safe side, you my add a new one `wpiw_anchor_class`.
   However I do think, it’s strange to call a filter `link` and apply it on a `paragraph`.
 * I would highly appreciate if you could add a filter for the anchor tag. Thanks
   a lot for your job anyway!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Filter for link class’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-instagram-widget_d7eadd.svg)
 * [WP Instagram Widget](https://wordpress.org/plugins/wp-instagram-widget/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-instagram-widget/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-instagram-widget/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-instagram-widget/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-instagram-widget/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-instagram-widget/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [ninetienne](https://wordpress.org/support/users/ninetienne/)
 * Last activity: [10 years ago](https://wordpress.org/support/topic/filter-for-link-class/#post-7316061)
 * Status: resolved