In my previous blog post I wrote about building a code box like this one :
Code: |
---|
|
However, kindly another blogger has pointed out that a nicely numbered code box is already available in WordPress free. I couldn’t find it, not for lack of searching, so thanks to http://tpenguinltg.wordpress.com/ for enlightening me on this.
To get a code box like this :
#!/bin/bash # rsync script rsync -avh --exclude="*.bak" /home/user/Documents/ /media/diskid/user_backup/Documents/
You’d need to do it like this :
See WordPress official link in resources below for full details.
You could also use the <code></code> tags and you would get this :
#!/bin/bash
# rsync script
rsync -avh --exclude="*.bak" /home/user/Documents/ /media/diskid/user_backup/Documents/
Which is done like this :
<code>
#!/bin/bash
# rsync script
rsync -avh --exclude="*.bak" /home/user/Documents/ /media/diskid/user_backup/Documents/
</code>
You could also use the <pre></pre> tags which would look like this :
#!/bin/bash # rsync script rsync -avh --exclude="*.bak" /home/user/Documents/ /media/diskid/user_backup/Documents/
Which is done like this :
<pre>
#!/bin/bash
# rsync script
rsync -avh --exclude="*.bak" /home/user/Documents/ /media/diskid/user_backup/Documents/
</pre>
Also of note is that different type of code are recognised such as css, cpp, delphi, java, perl, php etc for full list see the official WordPress page below.
So now you have some choices !
Resources
http://en.support.wordpress.com/code/posting-source-code/
https://doncharisma.wordpress.com/2013/07/04/how-to-add-a-code-box-in-free-wordpress-blog
Ha, the last time I coded was my basic computer science class in high school. Horrible. I guess my brain isn’t wired that way.
It seems often to be more about persistence than skill with programming and IT in general, I say this have taken a degree !
I was trying to figure out how ppl did this in their blogs. Thanks a lot. ^_^
Always a pleasure 🙂
I’ve added you on my links –> friends, you doing the same helps people find our blogs 🙂
Keep in touch …
Cheers
Don Charisma
Thanks for letting me camp out in your blog for a little while today. I had a great time and tried to leave my campsite as good as when I arrived. I’ll be back!
Hey Russel Ray, my pleasure and thanks for dropping in !
I camped out in your blog for a little while too, and left you a like:)
I’ve added you on my links –> friends, Cheers
Don Charisma
This is so useful! Thanks for this info! I’m going to try this in a bit!
Hey there, my pleasure, glad to share the love 🙂 … Good luck with your writing career … I’ve added you on my links –> friends, you doing the same helps people find our blogs 🙂
Keep in touch …
Cheers
Don Charisma
I wish this good stuff was not over my head! I’ll get there… and I’ll keep track of you to help along the way. Glad you are here.
Hey Jule, hope you get your aircon sorted, where I am it’s stupidly hot all the time and aircon a must at night …
The techno stuff, well I’m a graduate so it’s normal to me …
Good luck with your blog and life, keep in touch …
Cheers
Don Charisma
Thanks Don,
It is stupidly hot here, too. How the heck did people function in days of old? How did I, for that matter – back in the horse and buggy days prior to A/C? Ugh.
Hey Ajule, it can reach 45 dec C (113 deg F) where I am … I used to have the aircon on a lot (expensive but I felt neccessary), until I came down with sinus problems … since then I’ve been getting used to the temperature and less AC … it’s hot all year round where I am and my theory is that we get used to the heat, but takes some time … the other thing that helps is to de-stress yourself 🙂
Congratulations on earning a prestigious award!
Please follow the link for rules that come along with the Very Inspirational Blogger Award:
http://ravenkingblog.wordpress.com/2014/04/01/i-won-an-award/
Thanks hun, that’s much appreciated 🙂
I’m totally lost, but will keep stopping by.>KB
Only useful if you’re putting bits of code or want to highlight stuff, you’re more into pictures anyway ?
I need your help!!! I want to place a Facebook thumbs up like button on the Morning Story and Dilbert Blog. Can you do a “How To” for a Post?? I like pic’s and elementary instructions, you know, simple stuff….. Thanks for the consideration….
Take Care and god Bless 🙂 Kenny T