Writing Codes in Your WordPress Posts

wordpress-love

While publishing tutorials you might have struggled to add blocks around “Codes” that you wish to share with your audience. Some people use plugins, but with a simple trick you can publish your codes with blocks without installing any plugin.

For an instance you can use following code in your posts; just make sure to use text editor instead of visual editor:

<Pre><PRE STYLE=”font-family:monospace;
font-size:0.95em;
width:90%;
border:red 2px solid;
color:white;
background-color:#000000; “>
bodHOST Bandwidth on Demand
</PRE><Pre>

The result will be like this one:

Here, tag “pre” create a block for your code then you can define font-family, font size, width, border color, font color, and background color according to your taste. That’s it!!!

About Paul Lopez

Paul Lopez, a technology writer and sales & marketing executive at bodHOST.com, a cloud & dedicated server hosting company based in New Jersey.
This entry was posted in General Discussion and tagged . Bookmark the permalink.