Please help shorten code
-
This afternoon many forum members helped me out with having my blog “badge” on my blog along with code to copy and paste so that other bloggers can put it on their site and it would link back to me.
Here’s the final issue. The code is verrrrrrry long, as you can see on my blog, about halfway down in a text widget. Is there a way to shorten it (perhaps with tinyurl.com) or make the form field bigger so the code doesn’t go off the page? If I should use tinyur.com, what portion of the code should I shorten and what part do I leave alone? Here’s the code I’m talking about:
<a href="http://tryingtobegreener.wordpress.com" target="_blank"><img src="http://i518.photobucket.com/albums/u342/tryingtobegreener/TryingToBeGreenericon.png" border="0" alt="Trying To Be Greener"></a>Thank you in advance for any help!
-
Why don’t you just change the filename to something shorter? And put a Return at the end of every pointy bracket. And delete the border info. Then you can use:
`
<img src=”http://i518.photobucket.com/albums/u342/shortname.png” alt=”Trying To Be Greener”>
‘ -
What happened there? Lemme try again.
Actually, to shorten the URL, why not upload it to WP.com? With a shorter filename that will give you a much shorter URL altogether so your code will look like:
<a href="http://tryingtobegreener.wordpress.com" target="_blank"><img src="http://blog.wordpress.com/file-48.jpg" alt="Trying To Be Greener"></a> -
Raincoaster,
Thanks for helping out. Where and how should I upload it to WP.com? I use the image as my profile picture, so is it actually “uploaded” already where I could just use the code you put above? Is it shorter but I think it will still go off the page. Can I somehow make the field form wider from top to bottom so the entire code shows up without going off the page?Thanks again!
-
Here’s how your code may look using bit.ly. raincoaster has also given a better suggestion.
<a href="http://bit.ly/1Zpzlx" target="_blank"><img src="http://bit.ly/bwho5" border="0" alt="Trying To Be Greener"></a> -
If it’s your avatar, just right-click on your avatar and “Copy Image Location” to see where it is:
But if you use the regular uploader to upload it, you’ll take the word Avatar out and make it shorter.
The big issue is the length of the section img src=”http://blog.wordpress.com/file-48.jpg” alt=”Trying To Be Greener” which you can really only substantially shorten by changing the name as discussed above OR removing the alt text.
-
Ok, so when I clicked on my avatar, I got this:
`http://tryingtobegreener.wordpress.com/avatar/tryingtobegreener-128.jpg?1220494074′
So, I take out “avatar”, so it will look like this, right:
http://tryingtobegreener.wordpress.com/tryingtobegreener-128.jpg?1220494074So the entire new code should look like this???
<a href="http://tryingtobegreener.wordpress.com" target="_blank"><imgsrc="http://tryingtobegreener.wordpress.com/tryingtobegreener-128.jpg?1220494074" border="0" alt="Trying To Be Greener"></a>If so, I guess I just have to deal with it going off the page. You can’t have everything!
-
No.
The URL for the avatar is http://a.wordpress.com/avatar/tryingtobegreener-48.jpg That code you gave does not work. You cannot just remove major parts of a URL. You will have to upload the image using the image uploader, copy the URL there and use that.
-
I uploaded the image and then used the HTML option to get the code. Here’s what I got:
Still very long, right?
-
Strip out all of the height and alignment information. That will leave you with:
<img src="http://tryingtobegreener.wordpress.com/files/2008/09/tryingtobegreenericon.png" />Which, yes, is still very long. Another option is to register a blog with a very short name, like b.wordpress.com and upload to that. Part of the problem is your name is incredibly long.
-
-
-
Best option: combine ismailimail’s suggestion here:
https://en.forums.wordpress.com/topic/please-help-shorten-code?replies=12#post-244357with mine. So you get the short URL like XYZtinyURL.com or http://bit.ly/bwho5 and strip all the extraneous border text etc out so you get something quite small.
-
But there’s no way the code will fit nicely in the text widget. My suggestion: paste the code in a new post, and in the text widget write a short phrase with a link to the post.
- The topic ‘Please help shorten code’ is closed to new replies.