4 Ways to Add Code Snippets to Your Blog

When you write a blog post that features code, you’ll want to show your code. But, you don’t want it to act like code. What are your choices for adding code to a blog post? You can manually show your code, use a plug-in or embed it into your post. Which one do you choose?

4 Ways to Add Code Snippets to Your Blog

1. Code it manually yourself

Write the code to style it yourself without using a plug-in or hosting your code on another website. You can create a code snippet with HTML and CSS. With the HTML tags <pre> and <code> and CSS, you can style your snippet to work with your design.

Code Snippets in HTML and CSS

2. Use a plug-in

If you prefer not to code it yourself, your next option is to use a plug-in. For WordPress, you can use a plug-in called Code Snippets. With Code Snippet, you can manage your snippets easily.

Code Snippets WordPress Plugin

3. gist.github.com

Don’t want to code it yourself or use a plug-in and you have a github account? You can host your code on gist.github.com. They provide you with a way to embed code snippets on your blog.

gist.github.com

4. CodePen

Are you a CodePenner? If you are and have a self-hosted WordPress blog, you can embed your pens or use the CodePen Plugin. CodePen takes care of the code and formatting for you. Refer to CodePen’s documentation on the best method for you.

CodePen Embed & WordPress Documentation

Summary
Whether you create code snippets with code, use a plugin or host on gist.github.com or CodePen, these methods provide 4 different ways to show your code.

8 Ways to Freshen Up Your Blog

You keep your blog current by writing new blog posts. As you write more posts, you may decide to change the focus of your blog. Or you want to make some minor changes. What can you do to freshen up your blog?

You can tackle it in two ways: maintenance and tweaking your blog.

Freshen Up Your Blog

Maintenance

As you continue to write and create posts for your blog, your website can start to slow down or links no longer work. You should take this time to do some routine maintenance on your blog.

Broken Links

Websites change their links, remove content or go permanently away. You need to check your site for broken links. If you have WordPress, use the Broken Link Checker to find them. If you are using a different CMS, try W3C Link Checker.

Clean up your sidebar

Is your sidebar working for you? Look at the items in your sidebar and decide if you have links, forms or products ads that need to be updated or removed. You may want to replace them with links to recent or popular posts or a signup to your newsletter.

Clean up WordPress

Your WordPress database over time can get messy. You add, edit and delete posts. You manage comments by editing or deleting spam. This can cause your database to become bloated and slow.

After cleaning or optimizing your database, you should update any plugins and themes that you use. Then, delete any plugins you are no longer using.

Tweak Your Blog

By updating your blog with simple changes, you can help to freshen up the content of your posts.

Update Graphics and Photos

Are your photos and graphics working for you? You may want to change them out for higher quality photos. Pick out pictures that work better for your blog and brand. You can use one of the sites mentioned on the The Badass List of Free Stock Photos Websites for Designers or take your own photos.

Add headings to your posts

When you first wrote your posts, you may not have used heading. Headings are a way to organize and highlight important information. They range from H1 to H6. Headings allow you to break up your post into easily readable and scannable chunks.

Add call to actions

You can use clickable buttons to let your readers know what action to take. You may want them to sign up for your newsletter, contact you or buy a product from you. Adding clickable buttons is a great way to get your readers to engage with you.

Add pull quotes

Create a pull quote to jazz up your design and draw your reader’s attention to an important idea. Use these tips to draw your readers attention with pull quotes.

Summary

Regular maintenance helps to keep your blog running smoothly. By changing photos, adding headings, pull quotes and calls to action, you can update old posts and improve your relationship with your readers.

Photo Credit: http://startupstockphotos.com/