Displaying Grab My Button Code in WordPress.com

by SBA · 41 comments

A graphical despiction of a very simple html d...

Image via Wikipedia

When you see a blogging tip you can usually tell right away if it's for WordPress, Blogger or both. In our tutorial about adding a grab button scroll box , the code includes a html tag, <textarea>to create the scroll box. The box holds the customized html code for visitors to copy and paste your button on their blogs.

However, I may have forgotten the limitations on the free WP platform. One of the biggies involves CSS and HTML freedom. Bloggers on the free WP can't add high-powered html like scroll boxes.   WP.com doesn't give you an error, it just ignores the 'bad' html. If you innocently put the code in your side bar widget, you get 2 buttons and no scroll.  This is what happened to Amber's  Comeherelittlebug.  So what to do?

Amber asked for help on Twitter, so I volunteered to send the code, not realizing her blog is on WP.com. I didn't know she had tried my tutorial already and removed the 'box.' It helps to get the details.  :oops:   Somewhat embarrassed when the custom code did not work, I found an alternative and she was able to further refine it to scroll horizontally. I worked on it a bit more and added a horizontal scroll and smaller line spacing.

As a result of our collaboration, we now have a regular text gadget that looks like a scroll box. It's sort of 'fake' but does the job. Visitors still copy and paste to display your button image.
wp-grab-button

How to customize the widget

Basically you'll display your button image and place text below it. It's the real html but with tags converted to text.  This fools WP.com everytime! Some styling will add the scroll bars to avoid taking up space on your sidebar.

  1. Go to your dashboard, Appearance, Widgets and select the "Text - arbitrary text or html" widget. Drag it to your sidebar location. Let's add the widget code in two pieces.
  2. Create this code for your button to display above the box; includes the link to your blog: this is our button, just substitute your own url , image location, alt, etc. Including the link makes it easier to do the second piece of the code in step3.
    <a href="http://BloggingWithSuccess.net"><img src="http://farm4.static.flickr.com/3358/3279966696_6f63996198.jpg" alt="BWS tips button" width="125" height="125" /></a><div style="border: 1px solid #DDD; margin: auto; padding: 5px 10px; background: #F8F8F8 none repeat scroll 0pt 0pt; overflow: auto; height: 100px; line-height: 1.5em;">***</div>
    
  3. Now take the code for the blog link and image ( up to the < div tag) only, paste it into the converter box at Bulletin Board Forum (page to middle of screen), press the gray 'html to text' button.  Copy the converted text and paste it over the ***in the code in step 2. In our case we would paste this: &lt;a href="http://BloggingWithSuccess.net"&gt;&lt;img src="http://bloggingwithsuccess.netwp-content/uploads/2009/08/3279966696_6f63996198.jpg" alt="BWS tips button" width="125" height="125" /&gt;&lt;/a&gt;

The last step converted the tags for the scroll box to avoid WP.com translating them into a second image!

TIP: Some of you may find it easier to first compose the text in a draft post then copy into the sidebar. Read TimeThief's article at One Cool Site about managing text widgets.

Give it a try this way only if you use WordPress.com and want visitors to grab your button!

Reblog this post [with Zemanta]

0saves
If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.
4 Reasons For Subscribing
  • Get Full Posts Delivered Directly To Your Inbox.
  • Get Exclusive Freebies For Subscribers.
  • No "Buy This, Buy That" Mails!
  • 100% Privacy. Your EMail Address Will Never Be Shared With Any Third Party.
About Writer [Blogging With Success]About Author SBA is a web designer and co-founder of BloggingWithSuccess.net. She publishes BPWebNews a place for Blogspot tips and tricks. You can also find her on Twitter. Read SBA's other posts. She's also published a couple of guest posts.

Leave a Comment

CommentLuv Enabled

{ 40 comments… read them below or add one }

Sebastyne August 31, 2009 at 6:39 PM

OMG, you never believe this. I was just like 30 minutes ago thinking that I need to dig up that article on Blogging With Success about creating a button for your blog… And I updated my email inbox and there it was as an RSS feed! Are you mind readers or what?!

Reply

SBA August 31, 2009 at 8:18 PM

Well, if you read some of the comments on the tutorial for WP.org and Blogger then you’ll know we often have to read minds to interpret the problems! Sometimes it’s like writing in invisible ink when the comments editor eats the html that visitor is trying to send you.. lol
Here’s a quote “Hi Ann, I’m working in the dark a bit because you didn’t tell me where the image is or show me your test blog with the incomplete code. So my best guess is you don’t have the image uploaded to an onlline host (may be sitting in your desktop file?)”

Glad we could read your mind on this one. There are quite a few related links but here’s the main one http://bloggingwithsuccess.net/grab-button-advertise-blog

Reply

Crazy blogger August 31, 2009 at 7:03 PM

What is a Grab button

Reply

SBA August 31, 2009 at 8:27 PM

The link in reply to Sebastyne explains it. but in a nutshell it’s like a 125 x 125 ad with a link to you blog. The purpose is to have your readers and friends copy the code to create a widget to display the button on their blogs. I encourage my blogspot readers to grab this button if they find my tips useful.

Also see the one in our side bar for this blog — it’s appearing on quite a few sites already. Yours could talk about your blogging tips and tech news.

Reply

Amber September 1, 2009 at 4:39 AM

It’s me the girl who desperately wanted a scroll-box under her blog button. I’ve written my account of the events in question in lovely blog post.
http://wp.me/pjsYu-ez
I wrote the happenings the best I could remember considering this happened over the course of a few days, the whole thing is pretty funny if you ask me…and you will find out just how much I admire Blogging With Success, it is definitely a one stop blogging spot.
Thanks again!

Reply

SBA September 1, 2009 at 5:58 AM

Wow, your account is pretty funny. Thanks for grabbing our button and the nice compliments. I guess you’ve forced me to use my free WP test blog!!! Watch out I’m becoming a ‘triple threat’ — a little knowledge is dangerous.

Reply

Landscapers Brisbane September 2, 2009 at 10:57 AM

I was looking for some info. I stumble upon this post. Its very interesting blog. I can learn a lot here.

Reply

SBA September 2, 2009 at 4:36 PM

Welcome. Your comment was put in spam because you’re using keywords instead of a personal name. The url you left was not a blog — are you setting up a business blog? You might also consider using a gravatar.

Reply

Landscapers Brisbane September 4, 2009 at 2:39 PM

Sir I am working as a SEO I had just start it. I am new in this business. Promoting site its my work I am working for my client . I know its a business site its not my mistake. My client want this keyword up for site so, I am using. I would be very pls if you give me link with this keyword. Pls reply me here. Thanks.

Reply

SBA September 4, 2009 at 9:16 PM

I’m usually a sympathetic person, but not in this case. Your job is to promote your site, mine is to provide an interactive reader community around blogging (human and technical sides). Readers want to visit commentator blogs as part of social networking; they use google search for products and services.

We welcome your comments on your own time, using a blank url or better yet, why not start your own free Blogger or Wordpress blog.

Reply

Toan Nguyen Minh September 5, 2009 at 7:42 AM

Great idea :D Thanks for sharing :)

Reply

SBA September 6, 2009 at 11:52 PM

I’m anxious to see how your button looks. Left you a message via your contact form about your theme.

Reply

Megan January 6, 2010 at 10:19 AM

THANK YOU so much!!! I’ve spent so much time wrestling with wordpress and wondering why it kept eating my code! I like the overall style of wordpress better than blogger, but it’s terribly frustrating on the design front. So thank you for solving this problem for me!

Reply

SBA January 6, 2010 at 5:05 PM

Your button is creative. I hope you get a lot of links from it. You might want to start it off by showcasing a few that you grab — need not be on the sidebar, but point to a separate page? Good luck.

Reply

obaida January 25, 2010 at 5:29 AM

thank you

Reply

Janine April 13, 2010 at 5:22 AM

ugh. I have been at this all day…creating my button, uploading my button…trying to get my button to work on my wp site…ugh. Ok…I have the button…I have the scroll thingy…but there’s no html for anyone to copy and paste! And my scroll box is huge! Help! I’m almost there! Drag me to the finish line…PLEASE!!!

Reply

Janine April 13, 2010 at 6:21 AM

Just figured out that my html code is there, but the text color is white..on a white background….that’s bad. How do I change it? And I still need to make the scroll box fit the size of my button…?

Reply

SBA April 13, 2010 at 7:19 AM

Hi Janine,
Since all of your widgets use white lettering against dark background you need to override that. The size can also be adjusted. I started with 130px but you can change. So replace just this segment:

background: #F8F8F8 none repeat scroll 0pt 0pt;

with
background: #97C000 none repeat scroll 0pt 0pt; width: 130px;

Alternately, if you want a whitish background with black lettering in just the scrollbox, then just change the lettering color: Use this instead of what is listed above:
background: #F8F8F8 none repeat scroll 0pt 0pt; color: #000000; width: 130px;

Reply

SBA April 13, 2010 at 4:12 PM

I guess my instructions for step 3 are not clear — you should use the Bulletin Board Forum converter for the image and link code only —- not all of the code from step 2. So your converted code would be for:
<a href=”http://spoonful-of-sugar.com”><img src=”http://i934.photobucket.com/albums/ad189/3girlmomblog/Blogbutton1.jpg?t=1271115042″ alt=”BWS tips button” width=”125″ height=”125″ /></a>

Edit your text gadget, deleting everything you had put where the three asterisks were — all of the converted stuff after the segment:

line-height: 1.5em;”>

but you must leave the last ending divide tag </div>.
At this point use the converted text for just your image and link, inserting before the ending divide tag.
I tried to show your converted version but WP comments keeps changing it!

You’re almost there!

Reply

Janine April 13, 2010 at 7:25 PM

I must be a complete tech idiot. Now I can’t even get my button back up. It was there this morning with a scroll box and I tried starting over because it was getting confusing, but I have tried 6 times to paste the code from your site, inserting my url, and image location, AND inserting the converted code you gave me above where the asterisks were. Now all I have is a scroll box with my button inside of it. No text. I’m ready to scream and my neck hurts. Waa. What am I doing wrong? I had half of it last night, and now nothing is working!

Reply

SBA April 14, 2010 at 6:03 AM

This is like most tutorials where it makes perfect sense once you understand the concept. lol. WP on the free platform does not allow html except the kind that you want it to render onto the screen. It does not allow the ‘textarea’ tag with creates the scroll box so easily for other platforms. Hence the actual copy and paste below your button to be ‘grabbed’ must be ‘escaped’ or converted to text. I’ll rework the tutorial to come at it in a different way. Maybe you can help me after you implement your box? Go to this post on my test blog to see exactly how your widget code must look — http://ubloghere.wordpress.com/2010/04/13/code-for-spoonful-grab-button/
My version shows as black lettering, but your theme styling will override to white.
Just copy and paste it into your sidebar widget. Then study the final code to see where you (actually we) went wrong in the steps above. There’s probably a much less painful way!

Reply

Janine April 14, 2010 at 7:27 AM

You rock..thanks so much for the help…I’ll def. come back and pick up your new button! I put the code in my text widget. It worked, but the html scroll box is askew. Check it out if you have time. I’m done for tonight. I’ve prob. spent 10+ hours just trying to get my button to work. Blah. If you can, look at it and let me know what you think. It’ll def. work for now. You are amazing! I’ll study to see the error of my (our) ways tomorrow morn. Thanks again.
Janine

Reply

SBA April 14, 2010 at 7:38 AM

You’re welcome. You just need to center the image above the scrollbox. The same way you centered your photos of yourself and your husband. In the img tag add

class=”aligncenter”

Reply

Janine April 14, 2010 at 8:10 AM

I can’t thank you enough…really. You have brought sanity to my insane little blogging dilemma, and I will always be indebted to you! Ok, maybe that’s exaggerating, but I’m really appreciative for your incredibly smart noggin. Thanks again. I’ll be looking for your new button!

Reply

SBA April 15, 2010 at 1:38 AM

Here’s the new button — I need to put it with the scrollbox in our sidebar (we lost it when we converted to Thesis theme!)- This is the 150 x 150 size which in the grab code will resize to 125 x 125.

on your blog where you show the old image, just change the image url (leave sizing of 125 to fit your sidebar…) to
i282.photobucket.com/albums/kk272/SBA_jpgs/bwstipsbutton.jpg

You’re officially our front runner in using the new button! Thanks.

Reply

CT April 19, 2010 at 5:21 AM

You are awesome! Thanks for this; thanks for your site! I did it on the first try! :D

Reply

SBA April 19, 2010 at 5:40 AM

Happy to hear that! I had to track you down to see your image:
Cheap Thrills in Omaha button
Looks good…

Reply

Kim April 26, 2010 at 6:34 AM

I get the button on my WP blog, however, above my button there is part of my code written…I can’t get it to go away. It’s actually above the button, no where near the code for someone to copy?

Reply

SBA April 26, 2010 at 7:17 AM

You seem to have converted (escaped) too much of the code? try it again, but put it in a draft post and view it. I can look at it more closely tomorrow — so take it off the side bar if you can’t get it on the rety… I’ve copied the current source.

Reply

SBA April 26, 2010 at 9:02 PM

Hi Kim,
I put the code for you in this post on my test blog:
http://ubloghere.wordpress.com/2010/04/26/code-for-iwascreated2worship-button/
For future, note these ‘errors’
1. You added an extra link and image src to your album! So should have deleted:

<img src=”http://<a href=”http://s685.photobucket.com/albums/vv215/kjridgeway/my%20stuff/?action=view&current=blogbutton.png” target=”_blank”>

2. Some of this code was converted to text by mistake, sort of messing things up in general as WP tried to match closing html tag… but that’s another post!

Perhaps another approach would be to copy all of the tutorial text and just change your urls for blog & image, sizes and alt values… Please try a test that way to see if I should modify the tutorial with that suggestion… appreciate your help on that.

Reply

Kim April 27, 2010 at 7:37 AM

You my friend ROCK!!! Thank you so much! I knew I was picking up something extra, but could not figure out what it was! THANKS!!!!!!
Kim´s recent blog ..Alarm System Needed? My ComLuv Profile

Reply

Kim April 27, 2010 at 7:38 AM

BTW I will try out your suggestion and get back with you tomorrow on the clairty of it…will let you know then :)
Kim´s recent blog ..Alarm System Needed? My ComLuv Profile

Reply

Meggie May 10, 2010 at 3:25 AM

Hello, SBA, I have left a comment so you may have my email, thanks for the idea of having a contact box! I shall look into it. My article for this was really trying to make it look straight forward so that others less technological than I can have a go!
Blessings,
Meggie
Meggie´s recent blog ..Book Review: Twelve Extraordinary Women My ComLuv Profile

Reply

SBA May 10, 2010 at 3:51 AM

I sent you my comment on your scrollbox. Check you email. Let me know if I can help…

Reply

Nitya tripathi July 7, 2010 at 4:18 PM

I will try this for my blog…..

Reply

SBA July 8, 2010 at 2:28 AM

Let me know when you’ve added your button!

Reply

Emily July 24, 2010 at 10:12 PM

I have the button displayed- YAY! But where the code is supposed to be for other people to get, is blank. How do I get the code to display?

Reply

SBA July 24, 2010 at 10:52 PM

I see you added the scroll box after sending this message? anyway you should use the center tags and add a space between your image and the scroll box. Good job!

Happy Couponing

Reply

Joyful Housewife August 23, 2010 at 10:47 PM

THANK YOU!!!! Oh my goodness my brain is fried! Thank you for this. This was so helpful and the only set of instructions I was able to successfully follow. I appreciate it so much.
Have a great day. =0)

Reply

SBA August 24, 2010 at 12:55 AM

Congrats Melanie!
Very nice buttons… You’re quite welcome for the tutorial. I know how html give most people a ‘brain freeze.’ You’re lucky yours runs hot.. lol

Reply

{ 1 trackback }

Previous post:

Next post: