WordPress Expert » Tips http://johnlamansky.com/wordpress Wed, 01 Jun 2011 18:58:49 +0000 en hourly 1 http://wordpress.org/?v=3.3 Tip for Plugin Developers: Inline Changelogs http://johnlamansky.com/wordpress/inline-changelogs/?utm_source=rss&utm_medium=rss&utm_campaign=inline-changelogs http://johnlamansky.com/wordpress/inline-changelogs/#comments Fri, 03 Jul 2009 16:51:12 +0000 John Lamansky http://wordpress.jdwebdev.com/?p=106 Recently, the Dev4Press and Weblog Tools Collection blogs made posts about integrating plugin changelogs into the Plugins dashboard. This functionality was something I was already doing in the SEO Ultimate plugin, so I thought I’d share my technique for doing this. (My method is different because it’s simpler and it integrates directly into WordPress’s update message.)

Here’s what an inline changelog looks like when implemented:

Example of inline changelog from SEO Ultimate

As you can see, a small notice like this helps users know at-a-glance what’s new in your plugin update.

Here’s the code you can incorporate into your plugin:

<?php
function my_plugin_update_info() {
	if ( $info = wp_remote_fopen("http://www.example.com/my-plugin-updates.txt") )
		echo '<br />' . strip_tags( $info, "<br><a><b><i><span>" );
}
add_action('in_plugin_update_message-'.plugin_basename(__FILE__), 'my_plugin_update_info');
?>

Of course, to keep plugin users happy, be sure that your inline changelogs are informative and unobtrusive. Happy coding!

(Plugin users, if you’d like to see this feature implemented in your favorite plugins, you could try sending the plugin author a link to this post! You could also check out the new Changelogger plugin.)

]]>
http://johnlamansky.com/wordpress/inline-changelogs/feed/ 5
Don’t Let Google Truncate Your Blog Post Titles! http://johnlamansky.com/wordpress/serp-title-truncation/?utm_source=rss&utm_medium=rss&utm_campaign=serp-title-truncation http://johnlamansky.com/wordpress/serp-title-truncation/#comments Mon, 02 Jun 2008 14:00:32 +0000 John Lamansky http://wordpress.jdwebdev.com/?p=58 Even if you have a catchy blog post title, it might not generate many clickthroughs in search engine result pages if it’s truncated with the familiar ellipsis in the SERPs. Here are two tips to avoid this:

  1. Show the Post Title First — The default WordPress theme shows the name of the blog before the title of the post. Reordering your title tag puts the text more relevant to the searcher’s query (the post title) first, encouraging clickthroughs. Plus it’s better for SEO, since your post title keywords are given more prominence.

  2. Keep Your Titles Short — Once you have your post titles at the beginning, you should avoid truncation by keeping the titles under 64 characters or so if possible.

]]>
http://johnlamansky.com/wordpress/serp-title-truncation/feed/ 1
4 Steps for Spring-Cleaning Your WordPress Blog http://johnlamansky.com/wordpress/spring-cleaning/?utm_source=rss&utm_medium=rss&utm_campaign=spring-cleaning http://johnlamansky.com/wordpress/spring-cleaning/#comments Fri, 30 May 2008 14:00:32 +0000 John Lamansky http://wordpress.jdwebdev.com/?p=71 It’s spring here in the northern hemisphere — why not incorporate your WordPress blog into your spring-cleaning routine?

Here are some ideas:

  1. Go to your Plugins page and look for plugins you aren’t using. If you temporarily aren’t using a plugin, just deactivate it. Or, uninstall the plugin completely.

  2. Find and fix those lingering 404 dust-bunnies.

  3. Optimize your database tables to clear out that accumulating table clutter.

  4. Clean out that obsolete code — check to see if you need to upgrade WordPress and/or your installed plugins.

While on the cyber spring-cleaning topic, it would also be a good idea to clean your computer and peripherals… a lot of gunk can collect there over time.

]]>
http://johnlamansky.com/wordpress/spring-cleaning/feed/ 2
7 Tips for the WordPress “Write Post” Page http://johnlamansky.com/wordpress/write-post-page-tips/?utm_source=rss&utm_medium=rss&utm_campaign=write-post-page-tips http://johnlamansky.com/wordpress/write-post-page-tips/#comments Mon, 24 Mar 2008 15:00:13 +0000 John Lamansky http://wordpress.jdwebdev.com/blog/tips/write-post-page/ Here are 7 useful tips related to WordPress’s “Write Post” page.

  1. Change a Post’s URL — If you’re using Pretty Permalinks, you can open the “Post Slug” section of the “Write Post” page and type in the text that you’d like to appear in the post’s URL. Among other things, this can be useful for shortening the URL of a post that has an abnormally long title.

  2. Post Macros — Install and configure the Shortcut Macros plugin, enter a shortcut text in the “Post” field of the Write Post page, save the post, and the shortcut will be expanded with the full text of your choosing.

  3. Disable the Visual Editor — By default the Write Post page has two tabs for post composition: “Visual” and “Code.” If you’d prefer to use the “code” editor exclusively, you can disable the visual editor.

  4. Publish Posts in the Future — The Write Post page has a feature that lets you “work ahead” on your blog. Learn about it here: How to Publish Posts in the Future.

  5. Custom Fields — Use this section to attach additional bits of information to your posts. The WordPress Codex has a good tutorial on using Custom Fields.

  6. Excerpt — Excerpts appear in lieu of the full post content on category/tag/author/date archives, assuming your theme supports it. By default, WordPress uses the first 55 words of the post as the excerpt. However, you can specify your own using the “Excerpt” section (or “Optional Excerpt” before WordPress 2.5).

  7. Remove Unused Functionality Bloat — Streamline your blogging workflow by using the Custom Write Panel plugin to create your own version of the “Write Post” page that omits functionality you don’t use (for example, perhaps the Trackbacks, Post Password, and/or Discussion sections).

]]>
http://johnlamansky.com/wordpress/write-post-page-tips/feed/ 3
How to Include Code in WordPress Posts http://johnlamansky.com/wordpress/code-in-posts/?utm_source=rss&utm_medium=rss&utm_campaign=code-in-posts http://johnlamansky.com/wordpress/code-in-posts/#comments Thu, 06 Mar 2008 16:00:38 +0000 John Lamansky http://wordpress.jdwebdev.com/blog/tips/code-in-posts/ If you’ve ever tried to insert code into a WordPress post, one of the following has probably happened to you:

  • Your HTML code was rendered as such.
  • WordPress stripped the code from the post entirely.
  • WordPress turned "straight quotes" into “curly quotes” — not good if you want your users copying/pasting code from your blog!

Here’s how to get around these annoying problem and make the code show as-is:

  1. Put the code into a basic text processing program (like Notepad), and perform the following find/replace operations:

    Find Replace
    < &lt;
    > &gt;
    " &quot;
  2. Click the “Code” tab on the WordPress post composition page, and then paste in the “fixed” code.

  3. Be sure to encase your code in a <code> tag for purposes of semantic correctness.

Check out the Writing Code in Your Posts WordPress Codex article for more lengthy take on the issue.

]]>
http://johnlamansky.com/wordpress/code-in-posts/feed/ 1
How to Turn Off WordPress’s Visual Editor http://johnlamansky.com/wordpress/disable-visual-editor/?utm_source=rss&utm_medium=rss&utm_campaign=disable-visual-editor http://johnlamansky.com/wordpress/disable-visual-editor/#comments Thu, 06 Mar 2008 15:00:06 +0000 John Lamansky http://wordpress.jdwebdev.com/blog/tips/disable-visual-editor/ Don’t like WordPress’s visual editor? Turn it off:

  1. In WordPress 2.5, click your username in the top-right-hand corner of your WordPress admin. In earlier 2.x versions, click “My Profile” in the same area.

  2. Uncheck “Use the visual editor when writing” under “Personal Options.”

  3. Click “Update Profile.”

And that’s it!

]]>
http://johnlamansky.com/wordpress/disable-visual-editor/feed/ 3
Is Your WordPress Theme Plugin-Friendly? http://johnlamansky.com/wordpress/theme-plugin-hooks/?utm_source=rss&utm_medium=rss&utm_campaign=theme-plugin-hooks http://johnlamansky.com/wordpress/theme-plugin-hooks/#comments Sat, 01 Mar 2008 20:26:29 +0000 John Lamansky http://wordpress.jdwebdev.com/blog/tips/plugin-friendly/ Did you know that the correct functioning of some plugins is dependent the “plugin-friendliness” of your WordPress theme?

The themes that come default with WordPress are okay. But if you’re using a theme designed by someone else, you might want to inspect it to make sure.

First go to the “Theme Editor” tab under the Design or Presentation section. You’ll see a list of files — click the files whose names are listed below, and look for these lines of code. (Of course, if any of this code isn’t there, you can always copy/paste it in yourself and click Save.)

  1. Header — Does your theme have this important line of code before the </head> closing tag? It’s used by plugins to insert JavaScript, CSS, meta tags, etc. WordPress itself even uses it to insert some header code.

    <?php wp_head(); ?>

  2. Sidebar — Although not as commonly used by plugins, it would be good for this code to be found in the “Meta” section of your sidebar:

    <?php wp_meta(); ?>

  3. Comments — This should go at the end of your comment form, before the </form> closing tag. It’s critical for the function of some plugins, such as the popular “Subscribe to Comments.”

    <?php do_action('comment_form', $post->ID); ?>

  4. Footer — This line of code should be at the bottom of your theme, before the closing </body> tag. It can be used, among other things, to insert JavaScript code or statistical information (spam counters, etc).

    <?php wp_footer(); ?>

Did your theme pass the test?

]]>
http://johnlamansky.com/wordpress/theme-plugin-hooks/feed/ 11
How to Embed XHTML-Compliant Flash http://johnlamansky.com/wordpress/embed-xhtml-compliant-flash/?utm_source=rss&utm_medium=rss&utm_campaign=embed-xhtml-compliant-flash http://johnlamansky.com/wordpress/embed-xhtml-compliant-flash/#comments Mon, 18 Feb 2008 17:15:52 +0000 John Lamansky http://wordpress.jdwebdev.com/blog/tips/embed-xhtml-compliant-flash/ According to Macromedia, the typical method of embedding Flash on a website is using the following HTML, replacing “myFlashMovie.swf” with the filename:

<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"
WIDTH="550" HEIGHT="400" id="myMovieName"><PARAM NAME=movie VALUE="myFlashMovie.swf"><PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#FFFFFF><EMBED src="myFlashMovie.swf" quality=high bgcolor=#FFFFFF WIDTH="550" HEIGHT="400"
NAME="myMovieName" ALIGN="" TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>

Not only is this messy-looking, it’s invalid XHTML, since the <embed> element isn’t part of the XHTML specification.

Often this wouldn’t be a problem, but since WordPress uses the stricter XHTML standard instead of the loosey-goosey HTML specification, using such code in your posts, pages, or template will likely cause your blog to not validate.

Thankfully, the same Flash video can be included in the following manner:

<object type="application/x-shockwave-flash" data="myFlashMovie.swf" height="250" width="800"><param name="movie" value="myFlashMovie.swf" /></object>

Not only is this much cleaner and shorter, it also avoids the <embed> element, ensuring XHTML compliance.

]]>
http://johnlamansky.com/wordpress/embed-xhtml-compliant-flash/feed/ 3
How to Publish Posts in the Future http://johnlamansky.com/wordpress/publish-posts-in-future/?utm_source=rss&utm_medium=rss&utm_campaign=publish-posts-in-future http://johnlamansky.com/wordpress/publish-posts-in-future/#comments Mon, 11 Feb 2008 15:30:17 +0000 John Lamansky http://wordpress.jdwebdev.com/blog/uncategorized/how-to-publish-posts-in-the-future/ Setting posts to auto-publish at a specified date in the future is a simple WordPress trick to help you “work ahead” with your blog, which is great for those times when you’re in the blogging mood. Here are the steps:

  1. First you’ll need a post you want to future-publish. Login to your WordPress admin. Go to the “Write” section to write a new post, or open one of your drafts.

  2. In the “Post Timestamp” box (click the plus sign next to “Post Timestamp” if you can’t see it), check the checkbox that says “Edit Timestamp.”

  3. Enter in the date and time on which you want the post to future-publish. The fields are: month, day, year, hour, and minute. Note that the timestamp is in 24-hour time, so “3:12 PM” would be “15:12″.

  4. Click “Publish,” and you’re done!

Now your post should show up under “Scheduled Entries” under Dashboard.

]]>
http://johnlamansky.com/wordpress/publish-posts-in-future/feed/ 7
7 Tips for Choosing a WordPress Theme http://johnlamansky.com/wordpress/choosing-a-wordpress-theme/?utm_source=rss&utm_medium=rss&utm_campaign=choosing-a-wordpress-theme http://johnlamansky.com/wordpress/choosing-a-wordpress-theme/#comments Tue, 05 Feb 2008 14:17:43 +0000 John Lamansky http://wordpress.jdwebdev.com/blog/tips/7-things-to-look-for/ Doing some WordPress theme-hunting? Here’s a checklist of things to look for in a good WordPress theme that’ll hopefully help you narrow down the choices:

#7 — Does It Use Header Tags Correctly?

An SEO fine point: see tip #14 from my WordPress SEO post.

#6 — Does it Have Valid Code?

If possible, validate a default setup of the theme. If the theme itself has errors, the designer probably hasn’t taken the greatest care in its development.

#5 — Is It So 1990s?

A theme that uses tables, font tags, excessive inline styles, etc. (as opposed to external style sheets) will bloat the file size of your blog’s pages, increase rendering times, and eat up bandwidth more quickly.

Virtually all of the popular themes should be fine on this point, but it’s some of the more obscure ones you might have to check or ask about.

#4 — Does It Support the Latest WordPress Features?

Check with the theme’s documentation and see if it supports newer WordPress features such as:

  • Tags (added in WordPress 2.3)
  • Widgets (added in WordPress 2.2)

#3 — Is It Sponsored?

Sponsored themes are usually an SEO no-no. If the theme’s website says something along the lines of “don’t remove the links in the footer,” that should raise a red flag.

#2 — Is It Unique Enough?

If you’re trying to create a visual brand with your blog, then try to avoid using the WordPress Default Theme or another theme that everyone and their dog has seen on some other blog.

Try to find a theme that isn’t used on an excessive amount of blogs, or get a custom theme developed if you’re willing to hire someone.

#1 — Does it Look Good?

It goes without saying that if the theme doesn’t convey a professional image (and if a professional image is important to you), don’t use it, even if it means you have to go with another theme that doesn’t quite do all of the above.

Finding the perfect theme is a bit like shopping: try some out, see what looks best, and have fun with it!

]]>
http://johnlamansky.com/wordpress/choosing-a-wordpress-theme/feed/ 10