Archive

Posts Tagged ‘Wordpress’

There’s a Lot of Spam Out There Apparently

July 19th, 2009 No comments

I never really thought that running spam plugins was necessary on a site that doesn’t get too much traffic (maybe one day…). But after I switched to this new theme, I decided to add the Akismet widget to the sidebar to show how many spam comments have been blocked by it.

akismet-5000-spamAnd, crazy enough as it is, it has blocked over 5000 spam messages on this little blog. That’s pretty incredible considering the traffic this blog usually receives. Goes to show how many automated tools out there are beating up sites with automatic comment posting…

Categories: Blog Tags: , ,

Disabling Automatic Post and Page Formatting in Wordpress Themes

July 16th, 2009 2 comments

Problem

Sometimes when working on Wordpress powered sites, especially those that require a lot of custom HTML/CSS formatting through the HTML tab of the editing page, you’ll run into instances where the automatic formatting Wordpress uses becomes really annoying. Wordpress runs a filter on the content of your pages and posts that automatically adds in paragraphs where you might not want them sometimes.

Obviously if you’re sticking to writing relatively simple posts without too much formatting, this isn’t a big deal. But if you using a lot of custom CSS styles in your pages to style pages in a more radical way without having to mess with template files, you’ll need a solution that allows you to bypass that automatic formatting.

Solution

There are a few ways to filter your automatic formatting in Wordpress but the following is the best. You need to add a bit of code directly in front of the call to “the_content()” that disables the filtering. So instead of calling the_content like you normally do in a theme page:

<?php the_content(); ?>

…you would add a single filter directly in front of that comment, like so:

<?php remove_filter ('the_content', 'wpautop'); ?> 
<?php the_content(); ?>

That will disable the formatting of the body of your page. Be careful with using this filter tag, as all of the clean formatting that Wordpress normally applies will disappear when you use it. Your best bet is to create a copy of whatever template page you want this to be applied to and rename it so you can select it as a custom template when writing your new page.

How to Exclude Pages from Your Wordpress Navigation Menu

July 16th, 2009 1 comment

Problem

Oftentimes when building out a CMS style Wordpress site, you’ll run into instances where you’ve added pages to your site that you don’t want to show up in the main navigation. This is especially true if you’re utilizing a drop down menu navigation system that can access your multi-level pages.

There are two ways to go about hiding these pages from your navigation menu. The 1st is to manually edit your menu code (most likely in your header.php file) to exclude individual pages by hand. While this work, it’s A) Clunky as hell and B) prone to breaking if a page is deleted and another one added, for instance.

Solution

exclude-page-screenshotDownload and install a plugin called “Exclude Pages From Navigation“. What this plugin does is add a small context menu on the right sidebar of your edit and add new pages (seen on the right) that allows you to check off whether you want that page to show up in the automatically generated Wordpress menus.

By unchecking that box, you hide your page from showing up, allowing you to use that page for whatever you like without having to worry about people stumbling upon it through your menu system.

Fixing 404 Error When Using Wordpress Pretty Permalinks with WAMP

July 13th, 2009 2 comments

Problem

When you’re developing locally for a client, you want to try and replicate the server environment as closely as possible. That’s why using tools like WAMP are so great because they provide you with a pretty much stock version of a typical server setup that will work for 99% of use cases when it comes to developing and deploying a Wordpress site. But sometimes, things break. And when they break, they don’t make sense.

A perfect example is using a default install of WAMP and trying to setup “Pretty Permalinks” with Wordpress. An example of pretty permalinks is setting your permalinks to /%postname%/ instead of the standard www.domain.com/p?=23. Obviously a favorable setup for SEO and usability.

But if you were to set the permalinks to that with a default WAMP install, your site will start throwing up 404 pages for all pages that are linked to with the new permalinks. The problem is that mod_rewrite is not turned on by default with WAMP, so Apache is incapable of rewriting URLs according to .htaccess rules that Wordpress sets when you modify your permalinks.

Solution

rewrite-module-screenshot

Click to Enlarge

In your taskbar in the bottom right of the screen in windows, left click the WAMP icon, go to Apache, then Apache Modules, then make sure that “rewrite_module” is checked. Checking that will automatically restart WAMP and will activate mod_rewrite, allowing you to modify your permalinks however you want while not breaking anything!

Introducing ‘Make Wordpress Do What You Want’

July 13th, 2009 No comments

So in both my own personal projects as well as projects I’ve been working on with other people, I’ve gotten to know Wordpress pretty well. It’s a surprisingly powerful platform, and while it does have its shortcomings (like sidebar management), it can be transformed into a pretty powerful CMS platform if the right tweaks are applied. So lately I’ve started keeping track of all of the different little “off the beaten path” tricks that I use somewhat frequently on Wordpress setups, especially on sites that are meant more as CMS sites than typical blogs.

Some of the tricks might seem brain dead simple and leave you wondering “Why are you showing me this?” while others I hope are things you might never have heard of. But the purpose of this series is to simple build up a pretty complete set of tips and tricks that someone using Wordpress as a CMS can reference when working on their own projects.

I’ll try and go into a little bit of explanation for each trick for both why you would use it as well as why it works the way it does. That way, you’re not just copying and pasting code into your site, you’re actually learning from what is going on. So tomorrow is the day I’m planning on kicking off this series. I have a good amount of tricks saved up so far so I’m going to try and post every other day or so to get this series full of all of the good stuff.

Best plugins for a new Wordpress Blog install

November 14th, 2008 3 comments
The title says it all.  When I decided to start up this blog, I took some time to go through the plugins section on the Wordpress site to see if there were any plugins that would really make my blog great.  Obviously this was just a blind shot in the air because I had never used Wordpress nor did I have a reason to need anything more than what comes with the default install.  But here we are anyways.  So these are the plugins that I picked to add to Wordpress install in the last few days: Broken Link Checker

Automatically checks broken links in your Wordpress blog and notifies you of any that it finds.  Broken links don’t help anyone, so I figured this was a good little maintenance tool

Google Analyticator

Makes embedding the Google Analytics tracking code really easy.  Granted, copying and pasting the tracking code is something a preschool kid can do so long as he eyes and an index finger. But still, it makes it trivial.  It also adds some settings that would require at least two fingers to change manually so that makes it totally worth it.

SEO Smart Links

SEO is pretty dull.  But it’s necessary if you want your site’s traffic to grow organically.  So any plugins that do this stuff for me gets an A in my book.  This plugin automatically searches through all of your posts and identifies tags and categories and parts of the body that are shared with other posts and pages on your site and turns them into links.

Since Search Engines crawl your site using your sites internal links, it helps to have a good web of links set up to make the crawling go as easily as possible.  Plus, I don’t have to do it.

Sociable

Sociable adds icons to the bottom of every post that makes adding that post to the popular social news sites a single click operation.  After setting up the plugin, I was presented with a list of news sites I had never heard of, but after a minute I found the ones I use pretty frequently (except for Hackers News unfortunately).  I added this plugin in the hopes that one day someone will submit me to Reddit or Digg.  I’ll probably end up doing it myself in desperation but still, it’s there if someone feels so inclined.

Video Quicktags

I set up this plugin because of my second post.  I had embedded the video, which was from Blip.tv, but then discovered that it was set to autoplay. I fucking hate autoplay.  So I set out to stop it.

I couldn’t figure it out from the Blip website.  Usually I’m good at that stuff, but that day I was failing pretty hard.  So I found some other video plugin and used that to embed the video and it worked great.  Then last night I went to my blog to check things out and discovered the video wasn’t working.  After a few minutes I just decided to toss that previous plugin and subsequently found Video Quicktags.

This plugin adds links to the top of the posting box for all of the major video sites that make posting a video a cut and past operation.

Plus there’s no autoplay.

WP-Spamfree

As I wrote in my previous post about WP-Spamfree, I chose this plugin over Akismet simply because it required less effort to setup.  That’s it.  I just didn’t want to put in the effort.  As long as it doesn’t block real comments, I will consider it a success.

Yet Another Related Posts Plugin

Kind of like SEO Smart Links, this plugin attempts to create a list of 3 links at the bottom of every post that point to other posts that are the most similar on your blog.  Some more SEO link building basically.  It’s supposed to run through every part of your posts, from the titles to the body to the tags and categories and use a special algorithm to choose the most relevant posts to link to.  This is all great, but you just need to make sure you have enough posts for this plugin to run through to really see success with this one.

XML-Sitemap

This is supposed to create a sitemap for your site after every post you make and then submit that to all the major search engines.  I know Sitemaps are important but I’m not sure if sending one after every post is really a best practice.  Plus, from what I’ve read, Sitemaps are only necessary if your site is hard to crawl for search engines.  If I find out this plugin screws anything up I’ll toss it but until then, I think it’s fine.

So that’s the list.  Not too many plugins there, and I feel like they all serve a specific purpose that should help me in some way down the line.  I’m sure I’ll be deleting some and adding some as time goes on, so I’ll write about that when it happens. Hopefully someone can use this list when they’re setting up their own Wordpress blog one day.
Categories: Computers Tags: , ,

Spam on day 3?!?!

November 13th, 2008 No comments
It has happened.  Getting spammed on day 3.  Here am I, waking up to an email saying I have a new comment, stoked like no other because people like me, and it’s an ad for Canadian Web Hosting.  While they might have gotten me if I lived in Canada, I instead live in one of farthest American cities from Canada.  Good try you web hosting Canuck. So how am I going to stop this spamminess?  Well I am going to install Akismet.  It’s a spam blocker for this here Wordpress thing.  I don’t have the time to install it right now, but tonight I will so I will do it and take some screenshots and write up a little tutorial on how to do it. In the meantime, if you’re in the mood for any web hosting north of the border, go ahead and get clicky on that link in the comments of my first post. Seriously though, don’t click it. Seriously.
Categories: Computers Tags: ,