Can I host my button on my sidebar at WP?

  • Unknown's avatar

    I see other blogs with a box on the sidebar which contains an html code/address for their button. Can I do that at WP? If so, how is it done?
    Thanks in advance!

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    Can you link to an example of how you’d like it to be?

    In the meantime check my new suggestion re your previous problem:

    https://en.forums.wordpress.com/topic/how-do-i-add-a-button-in-my-side-bar-digg-3-theme?replies=9#post-303698

  • Unknown's avatar

    Hi – here is an example http://www.lifeinahouseofblue.com/ You will see her “My Button” coding down on the left. I was wondering if I could do that on WP?

  • Unknown's avatar

    Hi again (sorry, wasn’t free earlier today).

    You need an image properly sized to fit in the sidebar: no more than 150px wide. After you upload it and get its URL, you need to use three different pieces of code (and paste the whole thing in one or two Text widgets after you prepare it in a simple text editor).

    (1) The code for the displayed image. The model is this:
    <img src="URL_OF_IMAGE_HERE"></a>
    (2) The code you give for others to copy and paste in their sidebar. Model:
    <a href="URL_OF_BLOG_HERE"><img src="URL_OF_IMAGE_HERE"></a>
    (That’s the code for an image that acts as a link when clicked. In the example you gave, this has also been used for the banner actually displayed; you can do that, if you prefer, but I think it’s pointless to have an image in your own page linking to that very page.)

    (3) The code you need in order to make code 2 itself show up in a box instead of producing the result it normally does. The easiest solution is a special “shortcode” provided by WP:
    [sourcecode language='html']COMPLETE_CODE_2_HERE[/sourcecode]
    Try it, but I don’t think you’ll like it (it’s designed with a different purpose in mind).

    A better solution is a bit more complicated. First you need to convert the functioning html characters (brackets, quotation marks etc.) into the html symbols for them. There are webpages that can do that for you, e.g. http://www.plus2net.com/html_tutorial/tags-page.php . So you take Code 2, convert it there, and copy the version produced. Then you can use either of the following (to get the code show up in a box):
    <div style="border:solid 1px #999;width:150px;height:38px;white-space:pre;overflow:auto;padding:8px;">CONVERTED_CODE_2_HERE</div>
    `

    CONVERTED_CODE_2_HERE

    (You may need to adjust the height number in the second.)
    And of course you’ll also add some short explanation/invitation somewhere, in plain text.

  • Unknown's avatar

    Oops – second version again:
    <div style="border:solid 1px #999;width:150px;height:260px;white-space:pre-wrap;overflow:auto;padding:8px;">CONVERTED_CODE_2_HERE</div>

  • The topic ‘Can I host my button on my sidebar at WP?’ is closed to new replies.