Add "Preview" Link to Manage Themes

Get That Preview Link Back!

Ever since WordPress added a Live Preview option to the Manage Themes screen, it’s been frustrating to test a plugin using multiple themes.

Why Live Preview sucks for developers

When using Live Preview, you can’t modify the URL of the page you’re visiting or open the preview in a new window or tab. Live Preview prevents you from viewing multiple themes at once in different tabs.

If you wanted to get the old Preview link back, you had to disable Javascript, then refresh the page, then open the links.  Continue reading “Add "Preview" Link to Manage Themes”

Simple Way to Get Plugin Status in WordPress

Active plugin volcano.

I have previously written on how to determine if a widget is active. This is helpful for widgets, but not for plugins.

WordPress has a couple of different functions that help you determine plugin status. They are both located in wp-includes/plugin.php

  • `validate_plugin()` spits out an error if the plugin file does not  exist or has an invalid header. This lets you know that the file is there.
  • `is_plugin_inactive()` lets you know if the plugin is not active (using the `is_plugin_active()` function)

A function to get plugin status

Using these two functions, I put together a one-size-fits-all function `get_plugin_status()`. Continue reading “Simple Way to Get Plugin Status in WordPress”

Yourls Google Analytics Link Tagging

In my last post, I wrote about the benefits of using YOURLS, a self-hosted link-shortening service. I’m finding that YOURLS is great, but it’s not perfect. Some of the issues I have experience are part of what you get using most URL shortener services.

Some of the downsides of using link shorteners are:

  1. Google Analytics doesn’t always capture the original referrer (and I have no clue how they do the rest of the time!).
  2. When generating links using the bookmarklet (or in this case, also the Yourls installation), there’s no easy way to add campaign, source, medium, content, and term tags for Google Analytics to track.
  3. Yourls doesn’t allow query strings on URLs by default, making overriding existing campaign tags difficult/impossible. For example: `http://katz.si/t?utm_source=2300`

I’m not the only one who wanted these things, so I’ve created a plugin that adds Google Analytics tracking to Yourls. It’s very cool.

Continue reading “Yourls Google Analytics Link Tagging”

Show Content Only Plugin – A Perfect Keyword Research Companion

Download the Plugin from WordPress.org

Another WordPress SEO Plugin by Katz Web Services

The Show Content Only Plugin enables you to show only a post or page’s content, without sidebars, footers, and other content.

There are many different reasons for wanting to show just the content, but there’s never been such an easy way to do it. This plugin adds a box in the post and page editor that provides you with four links:

  • Content Only
  • Content with Tags
  • Content with Categories
  • Content with Categories & Tags

This is very helpful in conjunction with the Google Keyword Tool, so that Google only analyses the content of your post or page, not the surrounding context as well.

Demo Links

Click the links below to see this article in the variations available.

Leave your requests, feedback, and any bugs in the comments below.

How to Prevent Loading WP-DownloadManager's CSS File

Stop loading WP-Downloads CSS File

If you want to disable the WordPress plugin WP-DownloadManager‘s download-css.css file from being loaded, add the following code to your functions.php file:

remove_action('wp_print_styles', 'downloads_stylesheets');

Alternatively, if you would just like to use your own stylesheet, you can add a file named download-css.css to your theme’s directory, and the plugin will automatically load your stylesheet instead.

Strip Extra ImageScaler Attribute from Plugin-Generated Code

I am using the ImageScaler plugin for WordPress on a project, and I like what it does, but it adds a non-standards-compliant attribute to images, such as:

<img class="" src="http://www.example.com/imagescaler/generated-image.jpg" alt="Example" width="258" height="234" imagescaler="http://www.example.com/imagescaler/original-image.jpg" />

To strip imagescaler’s imagescaler attribute, add the following into your functions.php file:

add_filter('the_content', 'strip_imagescaler');
function strip_imagescaler($content) {
	$content = preg_replace('/imagescaler="(.*?)".?/s','', $content);
	return $content;
}

Simple Taxonomies Formatting — Improve the Plugin's Code Output

Making the Simple Taxonomies WordPress Plugin Semantic

I’ve been using Joost de Valk’s Simple Taxonomies plugin for a couple of projects, and I’ve been very disappointed by the formatting of the terms output code.

When configuring the plugin, you have the option of choosing “Add terms to the end of posts” or “Add terms to the end of excerpts.” If you do, you get a <div> and a couple of spans. Not very semantic. Also, the code uses an #id, instead of a .class, meaning that if you have more than one post on a page with taxonomies, it no longer validates.

Simple Taxonomies uses terms, so let’s make a list of them!

Here’s a way to reformat the code and prevent overwriting in future plugin updates. We’re going to strip the code and use a definition list instead (<dl>). Definition lists in HTML have a term and description; just as a custom taxonomies creates a taxonomy and its terms. Continue reading “Simple Taxonomies Formatting — Improve the Plugin's Code Output”

Simple Vertical Align Plugin for jQuery

Everything in it's right place.
Sometimes you may want to vertically align a block item, but the CSS-only vertical aligning methods don’t make you feel clean.  Personally, I hate having to style items as a table/table cell to get them to vertically align in Internet Explorer.

jQuery to the rescue.  Using a jQuery vertical align snippet as my base code, I modified it to be a jQuery plugin that will allow you to use the function in the jQuery chain. Continue reading “Simple Vertical Align Plugin for jQuery”

MomJobSeeker.com launched!

Visit MomJobSeeker.com
Visit MomJobSeeker.com

Mom Job Seeker prepares mothers re-entering the workplace after their kids have grown up a bit. April Stensgard, owner, contacted Katz Web Design with the goal of having a business blog that would facilitate online event registration.

Faced with this task, I took WordPress, added the eShop plugin, and Event Calendar and Event Manager (now defunct) and rolled it into a custom event management solution. Continue reading “MomJobSeeker.com launched!”

How I fixed WP-DownloadManager 404 errors

Lester Chan's header
I use LesterChan‘s Download Manager plugin, and it’s great. Good interface, simple purpose. 

I recently found out that after upgrading a client’s site to WP 2.5, WP-DownloadManager was no longer working.  I followed the documentation on the plugin website, including resetting the permalink structure, but nothing worked.

For some reason the re-write wasn’t working properly: all the downloads were giving 404 errors.  I couldn’t figure it out, so I dove into the code.  I found the part of the plugin that rewrites the download links, and found the problem. Continue reading “How I fixed WP-DownloadManager 404 errors”

Admin Drop Down Menu plugin does not break WordPress 2.5 Image Uploader [updated]

The plugin has been updated. The multitudes may celebrate fewer clicks!

As sad as it is to admit (since the plugin has saved me thousands of clicks), Admin Drop Down Menu by Ozh breaks the WordPress image uploader. If you’ve tried everything WordPress tells you to do in order to fix that Image Gallery feature and multiple image upload capability in WordPress 2.5, and disable this plugin.

WordPress 2.5 help pages

After following each step recommended, I had to disable the plugin. What a shame!