In the very early history of this blog, I wrote 12 Tips for Blogging. Here are some more advanced tips for your posts.
- For technical posts, use monospace font for code, keyboard shortcuts, and commands, like this:
mkdir SomeFolder
. This can be done by using the<code></code>
tags in the text editor.- For larger blocks of code, I recommend using the <pre></pre> tags, or a code highlighting extension.
- WordPress.com user? Lucky you, WordPress has built in syntax highlighting! The
[code] ... [/code]
tags take care of it for you, with many different options such as multiple language support and line highlighting.
- Did you know that you can embed JS snippets in your post? Just switch over to the Text editor, and paste the code in between
<script type="text/javascript"></script>
tags! A word of caution though, WordPress will remove all JS automatically should you switch back to the Visual editor. - Take advantage of the Read More link! It saves your readers some grief of scrolling through the content of entire posts, and can marginally increase page load time. To add a Read More link for WordPress posts, go to the Text editor, and type
<!--more-->
where you would like the post to break. What’s more, it’s customizable. Read more… - Have an especially long page? Use
<!--nextpage-->
in the Text editor to break the post in to pages. It works natively and doesn’t require a plugin. - Have Twitter, Facebook, Yahoo! Profile, or LinkedIn? Use Publicize to automatically post a link to your social services whenever you write a new post!
- Embedding video from YouTube? Skip YouTube’s
<iframe>
embed code! Use[youtube=http://www.youtube.com/watch?v=VIDEO_ID]
, replacingVIDEO_ID
with the YouTube video code.- This works for way more than just YouTube! Dailymotion, Flickr, Vimeo, Vine, and many more are supported. Want to embed Google Docs, SoundCloud, or Gist content as well? There’s shortcodes for those.
- Before you hit Publish, always hit Preview to make sure that everything looks as intended.
In case something on the list doesn’t work, make sure you’re using the Text editor and not the Visual editor. There’s two tabs at the top right of the editor. Select “Text”, and you’ll see the source code of your post.