Tricks – center align sidebar/widget data and printing extra spases as such

  • Author
  • #387361


    Ok – so this may be mentioned earlier but i still felt like sharing it out loud here
    1 – many a times you wish that the texts or images etc – that you post in sidebars , mainly in text widget – should align at the center of sidebar – to do so you can use the div tag before your code –
    <div align="center"> your text etc </div>
    You can also replace center by – right !
    2 – You may have noticed that many times – if you type too many spaces/linebreaks together, wordpress skips them to a single space/linebreak. To preserve the format of your text as such you can use the pre tag , Text in a pre element is displayed in a fixed-width font, and it preserves both spaces and line breaks –

    <pre>  wow                  this is

    hope it helps anyone, good day !



    AAAAAAAAgh !!!!
    I spelt ” spaces ” wrong >.< lol !



    I always recommend that people who aren’t fluent in code design their text widgets in the Visual editor, as if it were a post. Then they can use all the formatting tricks they already know, like the column buttons, etc. Then click to the HTML editor, copy the code, and paste it in the widget.



    Hmmm – sounds much easier
    can this method work on shortcodes too ?



    I haven’t tried it, but I don’t know of any shortcodes that work in the sidebar at all. You could give it a shot and report back.


    Moderator Emeritus

    Archives (in a text widget) and polls work in the sidebar.

    For formatting position of shortcode objects on a post or a page look here:

The topic ‘Tricks – center align sidebar/widget data and printing extra spases as such’ is closed to new replies.