Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML

Zaynaib Giwa
Zaynaib Giwa
9,784 Points

Adding via to a custom twitter button

Hello all, I am trying to make a custom twitter button with a custom message a well. I am trying to add a via button to my code. This is what I have so far

  <a href="https://twitter.com/intent/tweet?text=Check%20Out%20Random%20Quotes%20Generator" title="Share on Twitter" target="_blank" class="btn btn-twitter" data-via="wpbeginner"
 > Twitter</a>

CSS code

.btn-twitter {
    background: #00acee;
    border-radius: 0;
    color: #fff
}
.btn-twitter:link, .btn-twitter:visited {
    color: #fff
}
.btn-twitter:active, .btn-twitter:hover {
    background: #0087bd;
    color: #fff
}
Zaynaib Giwa
Zaynaib Giwa
9,784 Points

''' <a href="https://twitter.com/intent/tweet?text=Check%20Out%20Random%20Quotes%20Generator" title="Share on Twitter" target="_blank" class="btn btn-twitter" data-via="wpbeginner" > Twitter</a> '''

1 Answer

https://twitter.com/intent/tweet?text=Check%20Out%20Random%20Quotes%20Generator&via=YOURTEXT

So add &via=YOURTEXT to your URL

More information about Twitter Intent: https://dev.twitter.com/web/tweet-button/web-intent