WordPress Expert » Troubleshooting http://johnlamansky.com/wordpress Wed, 01 Jun 2011 18:58:49 +0000 en hourly 1 http://wordpress.org/?v=3.3 How to Fix Missing Post Dates in Your WordPress Theme http://johnlamansky.com/wordpress/missing-post-dates/?utm_source=rss&utm_medium=rss&utm_campaign=missing-post-dates http://johnlamansky.com/wordpress/missing-post-dates/#comments Thu, 26 May 2011 14:41:02 +0000 John Lamansky http://johnlamansky.com/wordpress/?p=124 Editor” and repeat the following steps for each of your theme files Look for instances of this code: <?php [...]]]> The problem:
When you have multiple posts published on the same day, the post date only shows up for the first one when you view the posts on your site.

The fix:

  1. Go to “Appearance > Editor” and repeat the following steps for each of your theme files
  2. Look for instances of this code:
    <?php the_date(); ?>
  3. Replace that code with this code:
    <?php echo get_the_date(); ?>
  4. Click “Update File”

The explanation:
Most WordPress template tag functions that start with “the_” will merely output the values returned by their equivalent “get_the_” functions. However, “the_date()” is an exception to this standard because it adds functionality that’s not present in “get_the_date()”, namely, not outputting the same date more than once per page, which can be a feature or an annoyance depending on your desired functionality.

]]>
http://johnlamansky.com/wordpress/missing-post-dates/feed/ 4
How to Find and Fix 404 Errors http://johnlamansky.com/wordpress/404-errors/?utm_source=rss&utm_medium=rss&utm_campaign=404-errors http://johnlamansky.com/wordpress/404-errors/#comments Wed, 28 May 2008 14:00:25 +0000 John Lamansky http://wordpress.jdwebdev.com/?p=72 If you’ve changed post slugs, taxonomy slugs, or permalink structures, you likely created 404 pages (page-not-found URLs) along the way.

These 404 pages certainly aren’t helpful for visitors who stumble across them and can increase your bounce rate. It can be a particular problem if search engines, pingbacks, and/or internal and external links are sending traffic to the old URLs.

Here’s how to resolve the issue:

Stage 1: Identify 404 Problem Pages

  • If you’re registered with Google Webmaster Tools, you can view the list of 404 errors that the Googlebot has come across.

  • You can also use the 404 Notifier plugin, which can notify you via email or RSS feed whenever a 404 error is thrown.

Stage 2: Redirect

  • If the 404 errors are due to a change in permalink structure, upgrade to the latest version of WordPress. WordPress 2.3 and above will automatically redirect your old permalink structure to your new one.

  • If the 404s are because of changed slugs, or other, more complex content relocations, use the powerful Redirection plugin to point visitors and search engines to the right place with 301 redirects.

]]>
http://johnlamansky.com/wordpress/404-errors/feed/ 13
What to Do If Plugin Deactivation Breaks Your Blog http://johnlamansky.com/wordpress/plugin-deactivation-theme-errors/?utm_source=rss&utm_medium=rss&utm_campaign=plugin-deactivation-theme-errors http://johnlamansky.com/wordpress/plugin-deactivation-theme-errors/#comments Fri, 23 May 2008 14:00:06 +0000 John Lamansky http://wordpress.jdwebdev.com/?p=69 Say you just disabled a plugin, and now your WordPress blog’s front-end says “Fatal error: Call to undefined function.” Part of your site may even be missing.

The problem is that your theme is calling on the plugin you deactivated. However, since that plugin is gone, the site displays an error and then stops rendering the rest of the page.

Here’s what to do:

  1. Go to your WordPress administration. Click “Design” (or “Presentation”), then click “Theme Editor”.

  2. Where on your site did the error appear? If it was on your sidebar, click “Sidebar.” If it was only on a search page, click “Search Template.” If it was in the comments section, click “Comments,” etc.

  3. Now look for a function call that might be related to the plugin you just deactivated. For example, if you deactivated the Related Posts plugin, you might see some code like this:
    <?php related_posts(); ?>

  4. If you don’t plan on using the plugin again, and if you’re sure the code belongs to the deactivated plugin, just delete the code.

    Or instead, you can follow these instructions to alter the plugin function call so that it won’t break your blog when the plugin is deactivated.

    (If you’re new to theme editing, you might want to backup your theme first just in case.)

  5. When you’re done, click the “Save” button to save your changes.

  6. If you couldn’t find any relevant code, or if the problem still isn’t fixed, repeat steps 3-5 for the rest of your theme files.

If all else fails, reactivate the plugin to get rid of the error, and then consult the plugin’s documentation, contact the plugin author, or file a support request at the WordPress Support Forums.

]]>
http://johnlamansky.com/wordpress/plugin-deactivation-theme-errors/feed/ 21
Make WordPress and Firefox Adblock Play Nice http://johnlamansky.com/wordpress/firefox-adblock/?utm_source=rss&utm_medium=rss&utm_campaign=firefox-adblock http://johnlamansky.com/wordpress/firefox-adblock/#comments Mon, 10 Mar 2008 19:20:30 +0000 John Lamansky http://wordpress.jdwebdev.com/blog/troubleshooting/firefox-adblock/ This potential problem is applicable to those using the following, which is probably quite a few people:

As part of its functionality, Adblock inserts a Block tab next to Flash objects, etc. to make blocking that object as easy as a couple clicks.

The problem is, Adblock will insert the HTML code for this tab into the visual editor for a WordPress post that includes Flash.

And who wants code like this in their posts?

<a href="http://www.example.com/flash.swf" style="left: 0px ! important; top: 0px ! important" title="Click here to block this object with Adblock Plus" class="abp-objtab-0032072711718704405 visible ontop"></a>

Thankfully, the solution is simple:

  • For Adblock, right-click on the Adblock link in the status bar and select “Whitelist this whole site.”

  • For Adblock Plus, right-click on the ABP icon in the status bar and select “Disable on (your domain name).”

This will stop Adblock from adding the “Block” tab (and its associated code) into your posts.

]]>
http://johnlamansky.com/wordpress/firefox-adblock/feed/ 0
WordPress Permalinks Just Won’t Enable? Try This. http://johnlamansky.com/wordpress/pretty-permalinks-wont-enable/?utm_source=rss&utm_medium=rss&utm_campaign=pretty-permalinks-wont-enable http://johnlamansky.com/wordpress/pretty-permalinks-wont-enable/#comments Fri, 08 Feb 2008 15:00:26 +0000 John Lamansky http://wordpress.jdwebdev.com/blog/troubleshooting/pretty-permalinks-wont-enable/ Have you tried to enable “Pretty Permalinks” but the change doesn’t show up on your blog?

I have, and I’ve successfully used this tactic buried in the WordPress Codex’s Using Permalinks article under the “Fixing .htaccess Generation Issues” section.

This only applies if your web host is using Apache (if you aren’t sure, chances are it is, but you might want to check with your host first).


Your host might have blocked the SERVER_SOFTWARE variable and this will cause WordPress’ .htaccess generation to fail. If you are sure that your server is running Apache, you can force WordPress to believe that your server is running Apache by changing your wp-includes/vars.php file. Follow the steps below to implement these changes.

  • Open the wp-includes/vars.php file using the built in file editor in your WordPress Admin panel. To navigate to this panel, login to WordPress, click on “Manage”, then on “Files”, scroll to the bottom and type in wp-includes/vars.php into the text box under the “Other Files” title.

    Look for

    $is_apache = strstr($_SERVER['SERVER_SOFTWARE'], 'Apache') ? 1 : 0;

    and replace it with

    // $is_apache = strstr($_SERVER['SERVER_SOFTWARE'], 'Apache') ? 1 : 0;

  • Add a new line under

    // $is_apache = strstr($_SERVER['SERVER_SOFTWARE'], 'Apache') ? 1 : 0;

    and type in

    $is_apache = 1;

Then click “Update File,” and try re-enabling permalinks.

Did this tip work for you? Have another permalink troubleshooting tip you’d like to share? Use the comments section below!

]]>
http://johnlamansky.com/wordpress/pretty-permalinks-wont-enable/feed/ 0
The “Undefined wp_die()” WordPress MU Installation Error http://johnlamansky.com/wordpress/undefined-wp-die-wordpress-mu-installation-error/?utm_source=rss&utm_medium=rss&utm_campaign=undefined-wp-die-wordpress-mu-installation-error http://johnlamansky.com/wordpress/undefined-wp-die-wordpress-mu-installation-error/#comments Wed, 06 Feb 2008 15:00:00 +0000 John Lamansky http://wordpress.jdwebdev.com/blog/troubleshooting/undefined-wp-die-wordpress-mu-installation-error/ Once when installing WordPress MU, after submitting the form in the setup wizard, I got the following error:

Fatal error: Call to undefined function: wp_die()

I did extensive research a la Google, and lots of other people seemed to have the problem [1, 2, 3], but I still couldn’t find the answer.

I finally figured it out: the database user I had added wasn’t setup with permissions to access the database. Apparently there’s a bug in WordPress MU that chokes on this instead of displaying an explanatory error message.

If that trick doesn’t work, I’d suggest double-checking your database information. In particular, if you’re in a shared hosting environment, you’ll probably have to prefix the database name/user with some form of your hosting username (e.g. “username_database” instead of just “database”).

Hope this helps someone!

]]>
http://johnlamansky.com/wordpress/undefined-wp-die-wordpress-mu-installation-error/feed/ 1