Need help? Check out our Support site, then


Showing Code in a WordPress Post

  1. I recently migrated my blog from Blogger to under my own domain. I have updated my blog buttons accordingly and would like to display the relevant code in a post so that readers can cut and paste my blog button code.

    I did this successfully in Blogger by going into the html editor and replacing relevant tags with > < "

    However when I do this in the html editor on my WordPress dashboard and then update, the code reverts to show my blog button.

    I would be grateful if anyone can tell me how to display html code in a post that is capable of being cut and pasted.

    Thank you.

  2. It's just basic HTML: <a href="The URL of the image that you are linking to">The text for the link</a>
    The code goes inside a text widget http://faq.wordpress.com/2006/10/18/put-an-image-in-your-sidebar/
    http://faq.wordpress.com/2006/12/24/what-is-a-widget/

    The easiest way of all to do this and be sure there are no coding errors is to upload the badge(image) into a post and link it there. Copy that code and paste it into a text widget and save it. (You don't need to either save or publish the post if you are going to display it in the sidebar.)

  3. Edit: timethief replied all now ;)

    Edit2: have you tried the <code> tag?

  4. Have you tried clicking on the code tab (next to the 'visual' tab)? By clicking on it, you should see a [code] button that should help you display your code.

    EDIT:
    Should I learn how to type faster? :D
    Well, I hope my suggestion can be of some help too :)

  5. @jaoche & devblog
    Thank you for your help. I think I went off on a tangent assuming this was another issue entirely i.e. inserting a button image into a text widget and displaying it in the sidebar. Sheesh :(
    I'm tired ... g'night :)

  6. TT, no biggy. Because you're always such a great help, you're forgiven... for now, but don't let this happen again. (J/K) :)

  7. @devblog: sometimes I believe TT has canned messages somewhere ;)

  8. I found the answer over on the wordpress.org forum (where I should have posted this question):

    Disable the RTE - access wp-admin, click on Users, click on My Profile, scroll to the bottom, uncheck the box bottom left.

    I then inserted the html replacing the <> tags and "quotes" and it all worked fine. Thanks for your speedy response.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags