WordPress.com News: New Theme: Dark Wood

March 18th, 2010

Go against the grain with “Dark Wood,” an eye-catching and playful theme. Bright colors and whimsical icons fuse with dark tones to provide a pleasing and harmonious design. Dark Wood is a three column theme with a rich wood textured background.

Dark Wood

When you’re looking for a theme with some serious character, Dark Wood could definitely be the one. Bright links and header icons give the design some real spice, complemented with a whimsical background.

Dark Wood doesn’t leave out the extras either. There are two sidebars that can be packed with widgets and the search box comes styled nicely to match the design.

Dark Wood's Sidebars

Dark Wood will provide a pleasing and harmonious backdrop for your blog. Give it a spin and see how you like it.

Dark Wood is available for all WordPress.com sites and is available for WordPress.org users over at the Theme Directory.



Otto on WordPress: Minimum WordPress Theme Requirements

March 17th, 2010

Too often I see themes missing the absolute minimum requirements to make the theme actually work properly. So I figured I’d make a list of things that ALL WordPress themes need to have in them, every time. These are WordPress theme-specific things. I’m not including obvious stuff like HTML and such.

Note: These are my opinions. You may not agree with every one of these. My opinion in that case is that you’re wrong, so there’s little point in arguing with me unless you have a rock-solid reason for disagreeing with me. In other words, I’m not trying to start a flame war, nor am I interested in one. This is just a checklist that I hope theme authors will start following more often. It would make me happy if all themes had these. :)

  • wp_head() in the HEAD section.
  • wp_footer() just before the /BODY tag. (So many themes forget this simple little thing…)
  • language_attributes() in the opening HTML tag.
  • body_class() in the BODY tag.
  • post_class() in whatever surrounds each individual post (probably a DIV).
  • Use of get_header(), get_sidebar, and get_footer inside every appropriate page template.
  • The Loop inside every page template (exception: very Custom Page Templates).
  • Proper use of widgets on the sidebars (dynamic_sidebar, register_sidebar, etc).
  • New to 3.0: add_theme_support( ‘automatic-feed-links’ ); in the function.php. This will make it do the feed links in the head for you, automagically.
  • New to 2.9: Thumbnail support. Come on, this is cool stuff, every theme needs to have it.
  • A special image.php template. Image attachments can have their own template and make theme’s have built in nice gallery-like support. You should make a special one of these to fit your layout.
  • Comments must use wp_list_comments(). Preferably without using a customized callback. But if you must make a callback, be sure to support threading properly! This is tricky without also having an end-callback. And you should use a List to do it (unordered or ordered, it doesn’t really matter). If you’re using DIVs, you’re doing it wrong.
  • The Comments Reply form should have id=”commentform”. If you change this, you’re breaking plugins.
  • Similarly, you need to include do_action(‘comment_form’, $post->ID); on your comment form too.
  • New to 3.0: Forget doing your own comment form at all. Just make the call to comment_form(). Then adjust it through styling or filters or what have you. Plugin authors will love you for doing this.
  • New to 3.0: Nav-menu support. It’s cool. Your users will love you for supporting it.
  • A couple of useful Custom Page templates. Like a no-sidebar one, or one that has a different number of columns. Just generic ones to let your user have a few built in options.

This list is by no means complete. It’s just off the top of my head for now. But honestly, too many themes don’t have even the basic ones, and I’d like to see that fixed. If you’re a theme author, help everybody out, let’s make a list of standards and adhere to them. Users hate editing their themes to support their favorite plugins, and with standards like these, we could make it so that they didn’t have to.


Ptah Dunbar: Hold your horses, it’s alpha software.

March 17th, 2010

I’m noticing a recurring event in the WordPress community that has happened before back when WordPress version 2.7 was in development. However this time, I’m on the other side of the fence.

Late 2008, WordPress version 2.7 was in development and the backend interface was to receive a new facelift based on the usability testing conducted–code name Crazy Horse. This was a major change to the interface and it didn’t come welcomed when the community first saw the base UI-sans design in trunk. I was even a bit frustrated as it looked horrible. Despite knowing that WordPress was still in development, the community started throwing negative criticism thinking that the barebones UI was the final look. However little did we know that the actual “design” was being actively worked on by Matt Thomas and the community was basing their negative criticism off of alpha software. Low and behold, the design was finally committed to trunk and everyone loved it!

Now in version 3.0, we’re getting a new menu management system. This is going to be a highly used feature so there’s been a lot of critiquing and concern about it’s current state. Days after the original feature freeze (Feb 15th), WooThemes navigation system was contributed into WordPress. The community was grateful of WooThemes, but also concerned about the feature freeze deadline and getting the system integrated into core from a UI and coding perspective. So in addition to a several other developers, I stepped in and we all started reworking the codebase and making the UI more inline with WP’s UI conventions.

Long story short, after one of my patches got committed, Jane Wells posted her thoughts on it’s current in-development state along with comments pretty much +1′ing her concerns. The gist of her post was summed up to WP needing “a *basic* menu feature that plugins can build on.”

And the irony being that that’s exactly what my patches were doing. I cleaned up the interface and I reworked the codebase to make it easier for plugin authors to add their own menu item types. So now with the menu super nova patch in, the underlying code to support any post type and taxonomy is there which is pretty much what plugin authors will want to extend in Menus. Before this patch, it wasn’t possible. And because that patch was already huge, I moved everything over to the next patch sprint which was to limit the UI’s menu item types to just pages and categories with the additional post types and taxonomies being disabled from the screen. To enable them would just be a checkbox away in the screen options tab. But before that could even happen, the menus system is being criticized—just like crazy horse—as if everything was final when we haven’t even hit beta yet.

My point is, hold off on any negative criticism regarding the development of alpha software. Features are still being actively fine-tuned and bugs are still being ironed out. So hold your horses, it’s alpha software.


Ajay on WordPress: WordPress Picks for the Week [03/17]

March 16th, 2010

WordPress Picks for the Week

Add Fuzzy Timestamps To Your Blog

By default, WordPress shows you absolute times of your posts. But, here's how you can add a "personal" touch by displaying something like "Posted yesterday" or "Posted 4 hours back".

Most Wanted Twitter Hacks and Plugins for WordPress

If you're not publicizing your blog on Twitter, then you're definitely neglecting a major promotion tool. Here are some popular tweaks that you help you harness the power of Twitter

How To Integrate jQuerry Scroll To Top Control in Wordpress

Here is how you can add a button using jQuery that will allow your visitor to immediately scroll to the top of the current page.

WP Comments Notifier

An open source application written in QT/C++ that alerts you when new comments are posted on your WordPress blog (works well with WordPress MU too), It displays an icon in your system tray to let you know if you have new comments,It also includes features that allow you to manage/reply/edit your comments directly from your desktop.

wp-comments-notifier

Get rid of unused post revisions

A simple query to delete all the post revisions along with the associated meta from your database. Remember to backup.

Shortcodes in Widgets

With one line of code in your functions.php, you can enable shortcodes in widgets as well.

Add Classes to post_class

3 methods to do that

More Twitter Shortcodes for WordPress

If you're keen on integrating twitter on your blog, here's two sets of shortcodes that you can use for displaying twitter search results and twitter trends

6 Ways to Display WordPress Post Content in Multiple Columns

Multi colum themes are the rage especially with magazine themes. If you're making your own theme, here are several methods to go about this multi-column design.

Get rid of unused shortcodes

Shortcodes remain in the post content even when you stop using them. Find and replace your waste shortcuts using this method.

How to Add an Author Info Box in WordPress Posts

This one is ideal for multi-author blogs, where you would like to add information about the author as on each post.

Our Friend: Sir Arthur Conan Doyle Online - Read the works of Sir Arthur Conan Doyle including Sherlock Holmes

Tags: ,

WordPress Picks for the Week [03/17] was first posted on March 17, 2010 at 12:16 pm.
© 2006-2009 "Techtites". Use of this feed is for personal non-commercial use only. If you are not reading this article in your feed reader, then the site is guilty of copyright infringement. Please contact us with the details.

Feed enhanced by the Add To Feed Plugin by Ajay D'Souza

scribu: scbFramework: Version 1.5

March 16th, 2010

I’ve recently learned that register_uninstall_hook() allows a single callback per plugin. This meant that if you were using both scbOptions and scbTable, for example, when a user uninstalled that plugin, either the option wasn’t deleted or the table wasn’t dropped.

This is now fixed by using a new method, scbUtil::add_uninstall_hook(). It also prevents multiple UPDATE queries to execute on each page load.

This also means that scbOptions, scbTable and scbBoxesPage now require scbUtil to work.

Other improvements:

  • new methods for scbOptions: get_defaults(); cleanup(); __isset();
  • new method for scbAdminPage: page_help();
  • scbAdminPage::submit_button() accepts an array of arguments
  • scbAdminPage can create top level menus
  • scbBoxesPage can assign the same handler to multiple boxes, with different arguments
  • debug() outputs at the end of the page, only for administrators

Here is the full changeset.


WordPress.com News: Set Your Blog’s Timezone by City

March 16th, 2010

One of my favorite things about working on WordPress.com is that improvements get made and pushed out as soon as they’re tested and ready. Just a day after I wrote about manually changing your blog’s timezone to account for Daylight Saving Time, Ryan updated WordPress.com so you can now set your timezone by choosing a city.

Here’s how it works.

Log in to your dashboard, click on Settings > General, and scroll to Timezone. You now have the option to pick a city that’s in your current timezone instead of a UTC timezone. For example, I live in the same timezone as Los Angeles, so I’ve selected that city.

Once you’ve set your timezone this way, you won’t need to change it again to account for Daylight Saving Time. WordPress.com will automatically update your blog’s time settings as needed.

If you’re interested, here’s a full list of the timezones we support for reference.



Otto on WordPress: Shortlink trick

March 16th, 2010

For you people who do your own theme work:

<?php if (function_exists('get_shortlink')) { ?>
<div><span class="shortlink">Shortlink:
<input type='text'
value='<?php echo get_shortlink(get_the_ID()); ?>'
onclick='this.focus(); this.select();' />
</span></div>
<?php } ?>

Basically that adds a little Shortlink: input box with the shortlink in it. Click the box, and the shortlink becomes selected for easy copy paste. It’ll work with any shortlink plugin that implements the “get_shortlink” function properly (like WordPress.com Stats).

Put it somewhere in The Loop or on the Single Post pages or what have you.


scriptygoddess: SEO Plugins and problems with the titles not rewriting (WordPress)

March 16th, 2010

I can't speak for anyone else who has run into this problem, but I know I have run into it on more than one occasion. Having just figured out my particular issue this time, I'm making a note for myself (and anyone else who may have the same problem).

You may run into this problem if you have a template that you have "hardcoded" the header (in my case – it was a custom page template that actually needed a completely different header than the rest of the site – so I opted not to use "get_header()" on this template and just put the custom header right there in my custom page template…)

I *did* remember to include the "wp_head()" – so that wasn't the issue (although I have fogotten to do that on other occasions and that will cause all kinds of trouble, including seo plugin stuff not working) – but in this case – the other meta tags were coming in – but the titles weren't being rewritten.

The problem was the fact that I wasn't using get_header() – this must be the function that kicks off the search for that title tag and replaces it with the rewritten titles. If you don't use get_header() – your titles will not be rewritten.

You will run into the same problem even if you don't "hardcode" your header – and use the "include" line instead:

include( TEMPLATEPATH . '/header2.php' );

Whatever happens with "get_header()" – you need to run it to get those titles working.

(I've since updated this post – scroll down to the bottom for the simplest solution!!)
So if you have a different header for your page template – what you need to do is within your header.php – determine which header file it should load in… but ONLY AFTER you have the title tags written out… You could even use the "is_page_template()" function to figure out which header to pull in.

So my header.php looked something like this for this project I was running into with this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><?php wp_title('«', true, 'right'); ?> <?php bloginfo('name'); ?></title>
<?php
if (is_page_template('my-custom-page-template1.php') || is_page_template('my-custom-page-template2.php')) {
include( TEMPLATEPATH . '/my-custom-page-template-header.php' );
} else {
?>
... rest of the header is here...
<?php } // endif custom page template checking... ?>

Now you can put your custom header in that "my-custom-page-template-header.php" (or whatever you want to call it) and on your "my-custom-page-template1.php and my-custom-page-template2.php, etc just use get_header() at the top like normal.

Actually – here's an even better/simpler option:

Name your custom header like this:
header-my-customheader.php.

Then when you call "get_header()" – do so like this:

get_header('my-customheader');

Related posts:

  1. Custom Template for Parent and Sub Categories (without a plugin) in WordPress When using WordPress as a CMS, I often repurpose the...
  2. Adding a block of HTML to a WordPress post One problem with the WYSIWYG editor in WordPress is that...
  3. Anchor Links in WordPress Posts – another shortcode solution I was recently asked by a client how they could...

Related posts brought to you by Yet Another Related Posts Plugin.


WordPress for Beginners » Tutorials: How to Add an Author Info Box in WordPress Posts

March 15th, 2010

Many blogs have an author information box at the end of their posts. This is becoming one of the biggest trends in WordPress blogs. In this article we will show you, how you can add an author information box at the end of your single posts without a plugin.

Screenshot:

Author Info Box in WordPress Posts

First open your style.css file in your themes folder and add this code:

#authorarea{
background: #f0f0f0;
border: 1px solid #d2d2d2;
padding: 10px;
width:500px;
overflow:hidden;
color: #333;
}
#authorarea h3{
font-size: 18px;
color:#333;
margin:0;
padding:10px 10px 5px 10px;
}
#authorarea h3 a{
text-decoration:none;
color: #333;
font-weight: bold;
}
#authorarea img{
margin:0;
padding:10px;
float:left;
border: 1px solid #ddd;
width: 100px;
height: 100px;
}
#authorarea p{
color:#333;
margin:0;
padding:0px 10px 10px 10px;
}
#authorarea p a{
color:#333;
}
.authorinfo{
padding-left:120px;
}

Note: You might have to modify the CSS file to match your theme formatting.

Once you have added that then open your single.php and add this code inside your loop.

<div id="authorarea">
<?php if (function_exists('get_avatar')) { echo get_avatar( get_the_author_email(), '100' ); }?>
<div class="authorinfo">
<h3>About <?php the_author_posts_link(); ?></h3>
<p><?php the_author_description(); ?></p>
</div>
</div>

There are many ways to get the images for the author profile, but we used Globally recognized Avatars, Gravatar. This code will get the avatar associated with the author’s email.

If you have any questions, feel free to ask in the comments.

How to Add an Author Info Box in WordPress Posts is a post from: WPBeginner which is not allowed to be copied on other sites.

Related posts:

  1. How to Display an Author List with Avatars in WordPress Contributors Page
  2. How to Display Author’s Gravatar on their Individual Posts in WordPress
  3. How to Highlight Author’s Comments in WordPress


WP Engineer: WordPress 3.0 Menu Update

March 15th, 2010

The new menus WordPress 3.0 just got an update, provided by Ptah Dunbar. Thanks Ptah, cool work! I checked out the new version. But first a screenshot of the backend:

WordPress 3.0 Menu Option Page

As you can see, you can build your menu from modules. Right now these are pages, posts, custom links, categories, tags and media. You can sort the entries in your menu via drag & drop. Here an edit menu item screenshot:

Wordpress 3.0 edit menu item screenshot


Related posts:


WP Engineer Favicon Thanks for subscribing our feed! Sponsor the WP Engineer Blog and get your brand in front of several hundred users per day!
© WP Engineer Team, All rights reserved (Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)


Otto on WordPress: Simple Twitter Connect 0.4

March 15th, 2010

I updated Simple Twitter Connect to version 0.4. New stuff:

Login message

The Login plugin now correctly displays an error message when somebody attempts to login as a user that isn’t recognized yet. This should prevent confusion about why “login doesn’t work” after activating the plugin.

Tweetmeme button

New Tweetmeme button plugin added. STC was already perfectly compatible with the existing TweetMeme plugins, but for completeness (and because it was easy), I added this. It’s much like the SFC Share plugin, really.

Note: In the future, an actual STC Share plugin will be created, which will send tweets directly from your own Twitter Application, instead of through TweetMeme. That will be a sorta replacement for this, in that it will have the same basic functionality.

Shortlink support (or lack thereof)

I made the plugin give more information about shortlinks and how they work. Basically, I’m not going to support shortlinks directly. There’s just too many of them. Instead, I have put in support for generic shortlink plugins. The idea here is that anybody can make a plugin to do some form of shortlink support, and this plugin can then use it automatically.

How this idea works:
1. A shortlink plugin author implements this function: “get_shortlink($post_id)”.
2. That’s it. Do that and the plugin will use it.

Any plugin author creating a shortlink plugin should be able to easily do this. In fact, one already has. If you use the WordPress.com Stats plugin, then you automatically get “wp.me” style shortlinks. STC will use them because they implement this function in a pluggable way.

This is also the best solution for people who prefer to implement their own shortlinks in some custom manner. All they need to do is to create a get_shortlink function that returns the shortlink string, and voila, it’ll be used.

So, there you go. Enjoy.


QuickOnlineTips: How to Make WordPress Faster and Safer

March 15th, 2010

Guest Post by Mark.
I admit, there are a lot of articles on the topic of promising you to share how to make WordPress faster and safer. Most of them under deliver. I’ll try my hardest not to make this article get into that category.

Before we start, I want to ask you: Have you ever heard about the 80/20 rule? This rule states that 80% of your results come from 20% of your efforts (80/20 is just a rule of thumb, it can be 90/10, 70/30 and so on.) My point is, the same principle applies for making Wordpress faster and safer. Spend several minutes, change some things, and reap big results. Those will be covered below.

How to Make WordPress Faster

When it comes to making Wordpress faster, 2 things matter most:
-  Hosting
-  Optimizing Wordpress

a) Hosting – How to Choose a great WordPress host

99.9% of webhosts support Wordpress. So, when it comes to the question ‘Which is the best Wordpress hosting solution’ you’re actually asking: ‘Which is the best hosting solution?’ Honestly, it’s very hard to give an answer to this question. The best answer would be, it depends (on your needs.)

There are some research sites like Netcraft that provide monthly reports on the most reliable hosting solutions. However, most of the hosts there, are for businesses and cost over $100 monthly. On the other hand, you can go with the most popular solutions (following the logic: if they’re popular and a brand, they must be at least above average.)

Another thing you definitely want to do before deciding to deal with a web host is to check out the business via BBB. In my experience, there seems to be a high correlation between the BBB rating for the company and the actual reliability that the company will offer.

To get to the point, which hosts do I recommend?

  • Hostgator.com (I personally use it for more than a year). HostGator are ThePlanet resellers (and ThePlanet is ranked as one of the most reliable hosts by NetCraft is some of their reports). Hostgator also has A+ BBB grade.
  • GoDaddy.com, has an A+ BBB grade and I heard very positive reviews from friends. They aren’t mentioned by Netcraft in many of their reports, though.
  • Hosting4less.com – I was surprised to see this company consistently ranking in the top 10 on Netcraft monthly reports, after investigating them I found they have an “A” grade from BBB and existing for quite a long time. So all data indicates they’re great.

Please be aware I haven’t mentioned many well-known hosts in this list. I was shocked to see that many of them (I don’t want to mention any names) aren’t even BBB accredited businesses!

b)  Optimizing WordPress

By optimizing Wordpress, I mean caching and compressing EVERYTHING (CSS files, the Wordpress database and so on.) Obviously, you want some automated solution to do all this for you.

Okay, so we need a caching plugin. Many people prefer WP-Super-Cache. However, my tests have shown very small or almost no significant improvement in performance when using this plugin. I just used this tool and measured my blog’s performance before and after I got the plugin enabled.

One plugin that improved my blog performance significantly was W3-Total-Cache (the creator is the Chief Technology Officer at Mashable.)

Proof: Here’s a screenshot of my blog speed without any caching plugin:

before caching

Now, here’s a screenshot with WP-Super-Cache enabled:

after super-cache

As you can see, this plugin not only didn’t improve my blog performance but also made it worse!

Now, let’s try WP-Total-Cache:

after total-cache

The speed improved by 300%! Why? Well, the author has a good explanation here.

Conclusion: WP-Super-Cache is way more popular than WP-Total-Cache. However, if something is popular it doesn’t have to mean it’s better than the less popular alternatives!

How to Make Wordpress Safer

Here’s a checklist of some of the basic things to make Wordpress secure:

  • Do you use the latest Wordpress version?
  • Is your computer clean of viruses and spyware? Key loggers can steal your username and password
  • Is you password strong enough? Do you have numbers and special characters?
  • Have you changed your default ‘admin’ username? See how.

Honestly, while researching, I found many posts on how to secure Wordpress but they all seemed to be repeating what is said in the Wordpress Codex on this topic. So go and read it, better do that than read hundreds of fancy posts on new techniques to secure Wordpress. Get the basics right before attempting something advanced.

In case you want maximum security, add a second layer of protection with AskApache Password Protect plugin. Warning: Test this plugin on a test blog first before attempting to use it on your main blog. And read the full warning in the codex above.

I don’t recommend you use this plugin unless your blog is extremely popular (gets 50k+ visitors per day.) Let’s be real here…most hackers attack the most popular blogs manually. Not many go after the less popular ones (they might use automated tools for the less popular ones but if you upgrade your installation regularly and use some basic plugins for protection like WP Security Scan, you’re safe.)

Also be sure to backup Wordpress. Oh, and forgot to tell you, that’s my site by the way. Feel free to subscribe if you want to. I hope you’ve learned a lot!

Mark is currently one of the authors for Mix The Net, a site for helping the casual surfer get more of the web. You can also write guest articles and share your WordPress tips and tricks.

  1. Use OpenDNS to Browse Faster, Safer, Fix DNS Errors
  2. Plugin Sandboxing in WordPress 2.2 : Safer Activation
  3. Upgrade Wordpress 2.1.3 Faster with Changed Files List
  4. Faster Multiple Wordpress Upgrades via Shell Access
  5. Make Your Site Faster with Google Page Speed, Firebug

Original article: How to Make WordPress Faster and Safer
Copyright 2010. Quick Online Tips. All Rights Reserved.

Twitter Facebook


scriptygoddess: Custom Template for Parent and Sub Categories (without a plugin) in WordPress

March 14th, 2010

When using WordPress as a CMS, I often repurpose the "posts" as other types of content a site may need. For example, news or press releases, or any information that might need the ability to be catgorized and/or tagged (like testimonials). However, this may mean that you need a completely different template for your news page than you would want for your testimonials page.

WordPress gives you the ability to create category specific templates. So let's say your "news" category has an ID of 5 – if you create a category.php page to be used by all the other categories, and also created a category-5.php page – then just your news page will use that template for the category archive page.

But – what if you have a huge handful of subcategories and you want them all to use the same category template as it's parent? (Let's also assume that we can't just make this the default template) Here's what I came up with. Let's say that Testimonials is our category – it has an id of 12. It also has a dozen or so subcategories (for argument's sake, lets say we've sorted our testimonials into groups from what types of companies these testimoinals have come from "Consulting Firms", "Web Host Providers", "Design Firms", etc.

We don't want to duplicate our category template for every subcategory we have. That's a nightmare to manage. So lets do this instead: In your category.php template file – before ANYTHING ELSE – even before you call get_header() – we add the following:

$thecategory = get_category($cat);
if ($thecategory->category_parent == '12' || $thecategory->cat_ID == '12') {
include(TEMPLATEPATH.'/testimonials-template.php');
} else {
/* include... default template file here like we included the "testimonials-template.php - or you can just wrap this around your actual template code... */
}

So what this does is it gets information about the category – if the current category's PARENT is 12 OR we are in fact looking at category 12 – then we pull in that special testimonials-template.php file… Otherwise the other code would be executed. (In the file I was using I just wrapped that around my existing category.php template code…

Please note: I have not tested this on if you have a SUB SUB category – I'm thinking $thecategory->category_parent probably only looks one level above the current category… so keep that in mind.

(I make the note above that this does not include a plugin because when I was trying to get this to work – one solution I had found online involved installing a plugin that kind of messed with my category heirarchy in a way I wasn't crazy about. Personally, I think this is a much simpler solution)

Related posts:

  1. Multiple Featured Content Galleries On a site I was working on recently, the client...
  2. SEO Plugins and problems with the titles not rewriting (WordPress) I can't speak for anyone else who has run into...
  3. Anchor Links in WordPress Posts – another shortcode solution I was recently asked by a client how they could...

Related posts brought to you by Yet Another Related Posts Plugin.


WordPress.com News: Time to Spring Forward

March 14th, 2010

Ah, spring, when a young person’s fancy turns to … blogging. And time changes. (Maybe baseball too, if that’s your thing.)

WordPress.com blog time settings follow the UTC time standard. This method allows us to keep the stats database lean and fast. That translates into free stats for everyone!

UTC doesn’t change over the course of a year. Because of this, you’ll need to adjust your blog settings to account for Daylight Saving Time manually. If you live in the USA, today – Sunday, March 14 – is the day to spring forward and adjust your WordPress.com blog’s time one hour ahead.

Update: There’s a full listing of when Daylight Saving Time begins around the world in this article on Wikipedia.

To account for Daylight Saving Time, log in to your dashboard, click on Settings > General, and scroll to Timezone. Then change your timezone to one hour ahead of your actual time zone. If you have your timezone set to, for example, UTC-8 (PST), you’ll need to change it to UTC-7.

We’ll make another announcement before the “fall back” change, which is on November 7, 2010.



Sivel.net: Happy π Day

March 14th, 2010

I’ve gotten into this bad habit of not writing about anything except WordPress on this site. It’s quite sad in a way that I have this great publishing platform and I only write about WordPress, and I do so very little.

Many years ago, I don’t remember how many exactly, I was challenged by my High School math teacher, that if I could memorize all the digits of π that were on the poster (86) above the white board, that I would get an ‘A’ on the final without having to take it. I spent a week or two, I even wrote a program for the TI-83 to help me learn it. In the end I learned somewhere around 280 digits of π and got that ‘A’.

From then until now, I have always held a special place in my heart for this number of numbers. I own the movie π, I own the book a history of π and I have spent the last eleven to twelve years incredibly interested in this number. Back in 1998 or so I actually ran a site dedicated to π on geocities that is now long gone and forgotten.

So in keeping with the color scheme of that old site I used to run, which I now realize was very Matrix-esque, have a happy π day!

π

Happy π day!

PS: From my days as an astrophysics major, I was taught that really only the first 42 digits of π are useful for computational purposes. But what fun is that!? Keep learning and cranking out those digits of π!


WordPress.com News: OMG WordPress BBQ at SxSW

March 13th, 2010

OMG WordPress BBQ logoThis weekend, thousands of WordPress users and fans (including many hosted here on WordPress.com) are among the people attending the South by Southwest (SxSW) Interactive conference in Austin, TX. To celebrate this, we’re throwing a WordPress BBQ at SxSW tomorrow so that there’s a place for us all to get together.

If you’re a WordPress.com user attending SxSW (or you just happen to be in Austin), please join us for lunch after 12pm* tomorrow, Sunday March 14. Come, eat, meet some of the WordPress.com team, talk about the cool things you’re doing with WordPress on your site, let us know what we can do better, talk about some of the new features and themes you’ve been seeing here lately, etc. Think of it like a WordCamp without presentations. See how many WordPress.com staff you can spot chowing down on Matt’s favorite meal. :)

Location: Conjunctured coworking space, 1309 East 7th St., Austin, TX 78702. From the convention center, walk up to 7th Street, hang a right, and walk until you get to #1309. If you’re tired of walking, taking a cab is a decent option. Note that this is on the other side of I-35 from the convention center.


View Larger Map

* We’ll keep serving until we run out of food, so probably until around 2 or 3? We’ll have a hundred pounds of bbq meat, a bunch of sides, and dozens of gallons of iced tea, so come hungry.



aaron.jorb.in: More Twitter Shortcodes for WordPress

March 12th, 2010

Building on my WordPress Shortcode How To, here are two more Twitter shortcodes. I’ve also added a new project on google code to track all of my shortcodes.

The first new shortcode is for twitter search. It’s logically enough

 [twitter-search phrase='#haikufriday']

Like my last twitter shortcode, it caches the results for two minutes. It also includes some other options. You can specify the number of tweets using the number attribute. There is a default of 20. You can also specify a max and min tweet id using max_id and since_id . Finally, you can specify the language with the lang attribute. This defaults to English.

function jorbin_firestream_search($atts){
        extract(shortcode_atts(array(
        'phrase' => false,
        'lang' =&gt; 'en',
        'max_id' =&gt; false,
        'since_id' =&gt; false,
        'number' =&gt; '20'
        ), $atts));
        if ('phrase' == false){
                return false;
        }
        //*/ Build our search url and transient name
        $transient = 'tweet-'. esc_sql($phrase) . '&l=' . esc_sql($lang);
        $url = 'http://search.twitter.com/search.json?q='. urlencode($phrase) . '&show_user=true〈='. urlencode($lang) .'&rpp=' . $number;

        if ($max_id != false){
                $url .= '&max_id=' . (int) $max_id;
                $transient .= '&m=' . (int) $max_id;
        }
        if ($since_id != false){
                $url .= '&since_id=' . (int) $since_id;
                $transient .= '&s=' . (int) $since_id;
        }

        if ( $tweet_display = get_transient($transient) ){
                // It's allready been brought
        }
        else {

                if ($search = wp_remote_get( $url ) ){

                $results = json_decode($search['body']);

                ob_start();
                        $tweets = $results-&gt;results;
                         //*/
                        foreach ( (array) $tweets as $tweet){
                                $tweetcontent = $tweet-&gt;text;
                                $newcontent = preg_replace('%@([^\s]*)%', "<a href="http://twitter.com/\\1">@\\1</a>", $tweetcontent);
                                echo "<div class="twitter_shortcode"><p>
                                <img class="twitter_shortcode_image" src="&quot;.esc_url($tweet-&gt;profile_image_url).&quot;"><span class="twitter_shotcode_username"><a href="http://twitter.com/&quot;.$tweet-&gt;from_user.&quot;">".$tweet-&gt;from_user."</a>&nbsp;—&nbsp;</span>". $newcontent ."</p>
                                </div>";

                        }
                $tweet_display = ob_get_clean();
                set_transient($transient, $tweet_display, 300);
                }
                else
                {
                        $tweet_display = "I'm sorry, no tweets are availailable at this time";
                }
        }
        return apply_filters('jorbin_tweet_content', $tweet_display) ;
}
add_filter('jorbin_tweet_content', 'make_clickable' );
add_shortcode('twitter-search', 'jorbin_firestream_search');

Like before, there are some classes for you to work with that should make it easy for you to theme these shortcodes. If you want for me to add more, comment below.

The second shortcode allows you to get and display a list of the most recent trends on twitter using the shortcode:

[twitter-trends]

This one doesn’t have any attribute. The output is in an unordered list with the class of twitter-trends.

function jorbin_twitter_trends(){

        $transient='twitter-trends';
        $url = 'http://search.twitter.com/trends.json';

        if ( $tweet_display = get_transient($transient) ){

        }
        else{
                $search = wp_remote_get( $url );

                $results = json_decode($search['body']);
                $trends = $results-&gt;trends;
                ob_start();
                        echo "<ul class="twitter-trends">";
                        foreach ($trends as $trend){
                                echo '<li><a href="' . esc_url($trend-&gt;url) . '"> '. esc_html($trend-&gt;name) . '</a></li>';
                        }
                        echo "</ul>";
                $tweet_display = ob_get_clean();
                set_transient($transient, $tweet_display, 120);
        }
        return $tweet_display;
}

add_shortcode('twitter-trends', 'jorbin_twitter_trends');

If you use any of these, let me know. If there are any improvements or more you want to see, comment below.


Il Filosofo: New WordPress Plugin: Custom Image Sizes

March 11th, 2010

I make a lot of WordPress themes, and frequently clients want to associate a particular size of image with a post. You can do this easily with WordPress by using add_image_size() to define an image and then by calling wp_get_attachment_image() later to print the markup for that image.

So for example, if I have an attachment image of ID number 123, I might do something like the following:


add_image_size( 'my-custom-size', 220, 180, true );
...
echo wp_get_attachment_image( 123, 'my-custom-size' );

Here, add_image_size() defines the custom thumbnail (in this example the arguments tell add_image_size() to make it 220 pixels wide, 180 high, and cropped), and

echo wp_get_attachment_image()

prints the markup of the image itself, <img> element and everything.

The Problem

This works great; WordPress even creates thumbnails in this size from now on. The problem is that it doesn’t apply to pre-existing thumbnails. And if people change their minds about what sizes they want their thumbnails to be (clients sometimes change their minds) you’re stuck with existing thumbnails of the wrong size.

In addition, if you call wp_get_attachment_image( 123, 'my-custom-size' ); and that size doesn’t exist, WordPress just scales down the larger-sized original image, which might cause some performance issues.

Solution: Custom Image Sizes

My solution is the Custom Image Sizes plugin. You activate it, and if you call wp_get_attachment_image() and related functions for an attachment that doesn’t have that size, WordPress will create it on demand.

As a bonus, if you pass a width and height of the desired image to wp_get_attachment_image() (and related functions), you can create any size image. So for example I could create a thumbnail 50 pixels wide by 40 high of attachment 123 with the following code, where '50x40' is '[width]x[height]':


echo wp_get_attachment_image( 123, '50x40' );

Download

You can download the Custom Image Sizes plugin here.


WordPress TavernWordPress-org: WordPress Dev Chat For 3-11-10

March 11th, 2010

wordpresslogoStatus check up first
The UI group is tackling a few design things while Jane is performing some testing at South By South West. After the testing is completed, all lingering UI will be done for WordPress 3.0. Ryan Boren stated that themes needed to be finished in the GUI, land the big menu patch and tidy off custom background and header stuff. The UI group will soon have comps on the background/header stuff. Ptah Dunbar has been doing a good job tackling the menu items and they are almost there.

Mark Jaquith will try to sneak in additional post thumbnail support for WordPress 3.0.

Tickets That Were Discussed In Depth
The next part of the meeting focused on specific tickets that were brought up for discussion. I’m just going to link to the tickets and let you read the log file for in depth discussion on these items.

wpmuguru: http://core.trac.wordpress.org/ticket/12357 high, blocker, 3.0, nacin->nbachiyski, new, Strings we need to hard code and WP_I18N prefix

miqrogroove: http://core.trac.wordpress.org/ticket/9591 high, normal, 3.0, Denis-de-Bernardy->ryan, reopened, sanitize_title_with_dashes() and remove_accents() improvements for i18n permalinks

westi: http://core.trac.wordpress.org/ticket/4739 high, major, future, einare->westi, closed, Some icelandic/Norwegian/Danish letters do not work in page slugs

miqrogroove: http://core.trac.wordpress.org/ticket/10041 high, normal, 3.0, miau_jp->Unassigned, reopened, like_escape() should escape backslashes too

miqrogroove: http://core.trac.wordpress.org/ticket/10607 normal, normal, 3.0, UnderWordPressure->westi, reopened, return variable $new_array in wp-includes/wp-db.php is not initialized

miqrogroove: http://core.trac.wordpress.org/ticket/11711 normal, normal, 3.0, miqrogroove->ryan, new, tag_id Doesn’t Work in WP_Query

miqrogroove: http://core.trac.wordpress.org/ticket/11845 normal, normal, 3.0, miqrogroove->Unassigned, new, mod_rewrite Should Not Be Used to Check Existence of index.php

miqrogroove: http://core.trac.wordpress.org/ticket/12136 normal, normal, 3.0, nacin->wpmuguru, reopened, Improve MS rewrite rules

nacin: http://core.trac.wordpress.org/ticket/12416 high, blocker, 3.0, Denis-de-Bernardy->ryan, new, “*_option(), *_transient() and *_meta() functions should all expect unslashed data.”

I also asked about the email that will be sent out to plugin authors in order to get a heads up on the changes which may effect compatibility. The email will be sent out before the release of WordPress 3.0 but the text of that email will also be announced on the WordPress developer blog.

To read the log file associated with this meeting, click here and scroll up.

How To Participate:

If you want to suggest a development oriented topic to be discussed at the next meeting, you can by visiting the WordPress development updates blog. If you would like to participate in the chat next week, install IRC or an IRC compatible client and connect to the following IRC server.

chat.freenode.net or any random server on the Freenode network and then join this channel at 3:30PM Eastern time or 20:30 UTC Thursdays. #wordpress-dev.


aaron.jorb.in: Portland WordPress User Group Presentation Upcoming

March 10th, 2010

I’m going to be speaking at the March Portland WordPress User Group Meeting on March 18th at 6:00pm at Webtrends and demonstrating some of the features that are coming up in 3.0. I’m aiming for this to be beneficial for both users and developers.

Right now, I plan on covering:

  • What the Multisite features mean to both users and developers
  • How to enable Multisite once you’ve upgraded
  • How to add and customize custom menus on your site
  • How to add a custom post type

If there is anything else that you would like for me to cover, please comment on the post there. I hope to see you there!


WordPress Community Podcast: BuddyPress Social Networking

March 9th, 2010

This weeks guest was Andy Peatling of the BuddyPress.org Project. BuddyPress is a social networking plugin for WordPress which ads many of the features found on sites like Facebook to WordPress blogs in as few as 10 minutes. We discussed how BuddyPress came about, some of the ways its used, some tips on getting started, customizing it and most importantly the features it provides. In news, there were a few nice plugin releases/updates and as always quick update on the WordCamp schedule.


W-Shadow.com: Showing Different Ads To Different Visitors

March 9th, 2010

Just today, I decided to run an impromptu experiment to test if visitors who come from search engines are really more likely to click on ads. It’s considered  ”common knowledge” by many bloggers who advise everyone to only show ads to search engine visitors (as a quick Google search will illustrate), but my own AdSense stats made me doubt that particular piece of advice. Hence the experiment.

So how does one show different ads to different visitors? Normally you could use the excellent Who Sees Ads plugin, but that doesn’t work for my site. I’m using the WP-SuperCache caching plugin which is incompatible with Who Sees Ads.

Instead, I wrote a JavaScript function that can analyse the HTTP referrer to distinguish between four types of visitors :

  • People who accessed your page directly, e.g. by typing in the URL (no referrer).
  • People who clicked an internal link to access the page (referrer from the same domain).
  • Search engine visitors; people who arrived via Google or Yahoo! (referrer matches one of the most popular search engines).
  • External visitors. This is basically a catch-all category for everyone who found your link on a third-party site that’s not a search engine. For example, this would include external forums and web directories.

Here’s the script :

function get_referrer_type(){
	var ref = document.referrer;
 
	if ( ref.length == 0 ){
		return 'none';
	}
 
	function getHostname(str) {
		var re = /^(?:f|ht)tp(?:s)?\:\/\/([^\/]+)/im;
		var matches = str.match( re );
		if ( matches ){
			return matches[1].toString();
		}
		return '';
	}
	if ( getHostname(ref) == document.location.host ){
		return 'internal';
	}
 
	var SE = ['/search?', '.google.', 'web.info.com', 'search.', 
		'del.icio.us/search', 'soso.com', '/search/', '.yahoo.',
		'.ask.'];
	for ( var source in SE){
		if (ref.indexOf(SE[source]) !=-1) {
			return 'search';
		}
	}
 
	return 'external';
}

The function get_referrer_type() returns one of “none”, “internal”, “search” or “external” based on the referrer info.

And here’s the script that I used to show different  AdSense ads to different people :

function get_top_adsense_ad(){
	var default_slot = '1111111111';
	var code = '<'+'script type="text/javascript"><!--\ngoogle_ad_client = "pub-0000000000000000";google_ad_slot = "%ad_slot%";google_ad_width = 336;google_ad_height = 280;\n//--><'+'/script><'+'script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></'+'script>';
	var slots = {
		'none' : '2222222222',
		'internal' : '3333333333',
		'external' : '4444444444',
		'search' : '5555555555',
	};
 
	var ref_type = get_referrer_type();
	if ( typeof(slots[ref_type]) != 'undefined' ){
		code = code.replace('%ad_slot%', slots[ref_type]);
	} else {
		code = code.replace('%ad_slot%', default_slot);
	}
 
	return code;
}
 
document.write(get_top_adsense_ad());

Unlike get_referrer_type(), this script is optimized for my site/AdSense account. Don’t try using it without modification ;) If you want to use it, replace “pub-XXXXXXXX”, the ad slot IDs and ad width/height settings with your own values (you can find them in your AdSense ad code).

As for the experiment, I’ll post the results sometime next week.


Copyright © 2010 W-Shadow.com. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@w-shadow.com so we can take legal action immediately.

WordPress.com News: New Theme: Titan

March 9th, 2010

Titan is a fantastic theme, now available on WordPress.com. It’s a highly readable, clean theme, with lots of options: four widget areas, a customizable header, and more.

Behold Titan!

An enticing color scheme and loads of customization make Titan a wonderful theme for you blog. To start things off the header has some nice social networking and RSS links, making it easy for users to keep up with your blog.

Right below the title is a highly customizable header. There are options to turn on and off categories and pages, allowing you to choose how users navigate your blog.

Titan's Header Options

Aiding in even more customization are four widget areas, including a nice footer widget area.

Titan's Footer Widget Area

Titan was designed by Drew Strojny and is available in the WordPress.org Themes Directory. You can check out Titan for yourself at http://titandemo.wordpress.com



Viper007Bond.com: Automattic

March 8th, 2010

As of today, I am officially a fulltime Automattic employee! I’ve been contracting with Automattic for a few months now but didn’t want to talk about it for fear of cursing it. It really is a dream job for me as I’m working with some of the best people in the business and the WordPress community and I couldn’t be happier. I want to thank Matt and everyone else at Automattic for giving me this great opportunity.

Automatticians In Quebec, October 2009

(I’m 4th from the right in the back row.)

No related posts.


WordPress TavernWordPress-org: WordPress GSoC 2010 Program Under Way

March 7th, 2010

The 2010 Google Summer Of Code program for WordPress is just about ready for prime time. The Google Summer of Code is a global program that offers student developers stipends to write code for various open source software projects. It was created in 2005 and continues to this day. Thanks to some willing students in 2009, we saw the creation of a new search API, and a theme framework in Elastic. When comparing the projects list from 2010 to 2009, they haven’t changed much although bbPress has been added to the list this year.

One of the project ideas that caught my eye was Template Versioning.

WordPress saves post revisions, but changes to theme files are not recorded, though the presentation layer is sometimes just as important. Build a versioning system for template files within the theme editor.

I wonder if any willing student will snatch up this project. This project idea also confirms that the built in theme editor isn’t going anywhere anytime soon.

For any students who want to participate in the WordPress GSoC project, you’re encouraged to review the application template from 2008 as well as the ideas from last year. However, the best way to increase your chances of being selected is to start learning the WordPress code base right now and submit a few patches so the mentors can get a basic idea of your abilities.

Good luck to any student who pursues one of the listed project ideas.