Category: Blogging

Source Code in WordPress

Since this is a technical blog, I like to post source code in various forms from time to time.  But, WordPress.com hasn’t been very easy in that regard.

WordPress.com was rather limited — the only thing I found was the [- sourcecode -] tag.  You can read more on that here.

Now that I am on my own site, I am looking to try to improve source code handling with a plugin.

Of cource, the Source Code post mentions that they use the SyntaxHighlighter plugin for WordPress.com. I found another list of plugins, but that just led me back to a different link to the same SyntaxHighlighter.  It does mention a Visual Code Editor that might be interesting.  Apparently, it will work in conjunction with the SyntaxHighlighter. Now, this list looks much more promising: 12 WordPress Plugins to Display and Highlight Code within your Blog

I did a little more looking into the WordPress version (SyntaxHighlighter Plus).  Here is a list of syntaxes supported.  At the bottom, there is some information about how to create your own syntaxes.

This Developer Formatter plugin looks very promising.  The problem is it didn’t work for me.  It seemed to break the editor.

I ran across this thread that talks about adding Code Mirror to the TinyMCE editor.  If I ever get time, I’ll have to try my hand at writing a plugin.

 

Sitemaps

I have been working with Google’s Webmaster Tools, and one of the things that it requires is a sitemap. It took me some tweaking to get it right, but here is what I learned.

First, I had to hand craft a sitemap php file for the main, parent site. The first thing that I struggled with was how to get the content type and XML heading in a php file. The solution was the header() command and to use the echo command.

Here is the heading of my sitemap page:

<?php
header("Content-Type: text/xml"); 

echo '<' . '?' . 'xml version="1.0" encoding="UTF-8" ' . '?' . '>' 
?>

The next hurdle was to determine how to include the last modified field. I found the filemtime() command could read the last time the file was changed. Then, the date() command using the DATE_W3C format puts it in the correct format that the sitemap expects.

Here is what an entry looks like.

  <url>
    <loc>http://digitaleagle.net</loc>
    <lastmod><? echo date (DATE_W3C, filemtime('index.html')) ?></lastmod>
    <priority>0.4</priority>
    <changefreq>monthly</changefreq>
  </url>

Finally, I found a plugin that would generate the sitemap for the WordPress blogs. The plugin is called: “Google XML Sitemaps”:

This plugin adds a new settings page where you can configure different options regarding the sitemap:

I didn’t need to mess with any of the settings. I should have blogged this as I was doing it, but if I remember right, I had to visit this page the first time to generate the sitemap. From there, it takes over.

At the top of the settings, you can see stats such as when it last generated the XML. You can also force it to rebuild the sitemap.

Resources

Ahh! Spam, Your Killing Me!

After moving my blog, one of the problems is SPAM.  And, it seems like it is getting worse.  I get all kinds of spam comments, some advertising various things like iPhones and worse, but the most annoying are these unreadable ones.  These are like random letters or like someone just slid their hand across the keyboard.

Akismet

On WordPress.com, they offer Akismet as a spam filter.  It seemed to do a decent job, and now that I see what happens without it, I realize that I took it for granted.  What I didn’t realize was that it was a service.  The plugin came preinstalled on my new website, but to activate it, I had to sign up for an account on the Akismet site.

I have been reluctant to sign up because I am not sure that I want yet another service.  The cost would probably be minimal if not free, but my profits are minimal if not none.

GASP

A little search for an Akismet alternative turned up iBlogZone’s article about GASP.  GASP stands for Growmap Anti Spambot, and you can read more about it on the WordPress Plugin Site.

I like this option because it isn’t a service.  From what I can tell, it adds a few features to the form that will trick spambots.  First, it looks like it adds a checkbox via Javascript.  Because spambots don’t care about running Javascript, they will not be able to check the box and therefore not be able to comment.  Also, it adds a hidden field that a human would not be able to populate.  The spambot will not realize it is hidden, and that is a dead giveaway.

So, we’ll see how this option goes.

Solve Media

Another option that looked very interesting was Solve Media.  This idea is pretty cool.  They take a problem and end up making money off of it!

I read about it at iBlogZone’s article.  The idea is that you put a Captcha on your comment form.  In order to comment, you have to type the letters from the image, and they are designed so that a spambot could not decipher them.  The cool part about this implementation is that they incorporate an advertisement into it so that you earn money at the same time.

I think I am going to hold off on this option for now.  It is another service after all, and I don’t have enough legitimate comments at this point.

Setting up Google Custom Search

The other day, I was trying to create a Custom Search for all of my blogs.  I had trouble getting it to work.  It wouldn’t save my URLs and therefore wouldn’t return any results.

I finally found a thread showing that you leave the protocol (http://) off when you enter the URLs.  So, my settings look like this:

URLs on Google Custom Search

One of the things that I don’t like about the search is that I don’t seem to have control over the ads on the page.  I don’t like the big section of ads before you see the search results.  That seems like it would be slightly annoying side for the users, but that’s just my thought.

Example Search Results Page from My Site

Still, it seems like it works well though.  All in all, I am happy with it so far.

Please comment any thoughts you have.

Resources

Tips for Moving a Blog

Through the past month or so, I have been working to move my blogs from WordPress.com’s free service to a Lunarpages website.  In doing that, I did a little search for tips on getting my readers and all to move over to the new one.  Here are some of the things that I found.

I found some helpful tips on this site:

MommaBlogga: Safely Move Your Blog (eMoms Group Research Project)

I really liked the “evaluate why you want to change” section.  I moved my blog because I don’t own and I can’t control my previous URL.

The other thing I learned was to use 301 redirects.  I see you can do that on WordPress.com, but it is considered an “upgrade”.  The instructions are here.  This blocking search engines idea might be a good option.

If you have any ideas, please comment below.

Linux Client for WordPress

Now that I have WordPress setup on a separate website, I am ready to attempt to use another program for writing the posts.  Here is my first attempt at finding such a program.

Options from Ubuntu Software Center:

In order to use these, I did have to go to the settings on my blogs and enable the XML-RPC feature.  In the admin tool, I went to Settings > Writing.  Under Remote Publishing, there is a setting for it.

Blog Entry Poster worked pretty easily once I got the RPC enabled.  Drivel was a little more difficult, but I found a post that helped.  I just had to use MoveableType.

I think I like QTM the best out of the three.  One feature I like is that it supports multiple accounts/blogs:

The accounts window in QTM

Another feature I like is that you can save/upload it as a draft.  So, what I will probably do is write and complete most of the post from QTM.  Then, I will go back and proof it online in WordPress.

QTM does seem to support adding images although, I don’t think I have tried it yet.  It doesn’t seem to support WYSIWYG editing though.  That isn’t that big of a deal for me with simple posts.  It does have a preview button.

Help! Maintenance Mode in WordPress

I got a little scare last night when I was updating one of my plugins in WordPress.  I got a little click-happy, and I think I didn’t let the page finish loading when I told it to install the update.

Anyway, I went to the front page, and I got a message like this: “Briefly unavailable for scheduled maintenance. Check back in a minute.”  Thankfully, I found the solution here:

WordPress Forums: [resolved] Blog now stuck in maintenance mode

The solution is to delete a .maintenance file in the root directory of my WordPress installation.  I use nautilus for my FTP connection to the website.  Because the file begins with “.”, it is hidden by default.  You can hit Ctrl + H to show the hidden files, and then I could delete the file.

How Do I Register a Domain Name

I have been trying register a domain name for our church’s website.  We already have someone who is hosting our website, and we just needed a domain name.  Here is what I learned.

I went to register our name on Network Solutions, thinking it was a good company and for some reason wanting to avoid GoDaddy.com.  When it brought up a price over $100, I thought I had better rethink the situation.  After some searching, I found a review on Consumer Search of different domain name services.  It’s recommendation was Name Cheap.com.  Because they were having a sale on the .org names, it was actually cheaper than GoDaddy.com!

I did look at a few other alternatives:

Resources

Adding Subscribe Button to WordPress

I have one problem with the Garland Theme that I chose for this website is that it doesn’t have a link the RSS feed for readers to subscribe.  No worries: the AddToAny plugin comes to the rescue.  Then, you can add a subscribe button as a widget.

Now, I have the subscribe button on the right side:

When you mouse over it, it opens up with the subscribe options:

Additional Resources: