In the Web design scene, the sense of community is extremely strong. We always talk about “giving back” and about how much we learn from those who do. A few names are popular and dropped here and there. But it’s all still just a bit too impersonal, isn’t it? Here at Smashing Magazine, we’ve decided to give you a more intimate look at our writers.
Among the people who regularly write for us, 15 agreed to answer our questions. We also challenged them to take a picture of themselves on the spot, with no time for make-up. This interview is not meant to give you any particular professional insight, even though we cover that ground a bit. Rather, it’s meant to introduce you to these people on a personal level. The illustrations for this article were created by Andrea Austoni, an illustrator from Poland who we are regularly working with.
We still have very little information about the Web design community itself. How many professionals are there around the world? Where do they live? These questions are still difficult to answer precisely. A List Apart publishes an annual survey, whose 2008 edition received responses from more than 30,000 people (2009 edition wasn’t published yet). We can perhaps imagine the Web design community an an entity, which is what A List Apart does to a large extent. But what if we focused on personality? What’s the first thing they do in the morning? What do they love and hate about Web design? What is their biggest strength and worst flaw?

If we could combine our writers into a single person, what kind of person would it be?
Who said working from home implies eating all the time? Our typical writer would be quite reasonable with junk food, eating only a kg a week.
Christian Heilmann:
Do good things, make myself redundant in doing them, and inspire and train others to take over to get the same great experiences.
Thomas Giannattasio:
When I look back on my life, I hope to see that I’ve improved people’s lives: making them simpler, more fulfilling and more enjoyable.
Paul Andrew:
Difficult question. Without being philosophical, I would simply say personal contentment.
Cameron Chapman:
I’m just along for the ride, trying to do as much of the things I love as possible, and avoiding the rest.
Jean-Baptiste Jung:
I’m a Christian, so most of my philosophy comes from that. I’m also an animal-rights supporter.
Inayaili de León:
Be nice. Put myself in other people’s shoes before criticizing them.
Jacob Gube:
My personal philosophy in life is to enjoy doing what you love doing.
Kat Neville:
I want to love what I do every day. I don’t want any day to go by where I think, “Wow, what an absolute waste of time.”
Aquil Akhter:
I want to do something innovative and creative, work on design and blogging. This is my current mission.
Most of our regular writers live in Europe:
Many live in the US:
But there is also Aquil, who is from Pakistan:
Because we are an English-speaking magazine doesn’t mean that the people who write for us are all American or British. In fact, most of them come from another country and therefore speak a different native language. If we combine them all together, we’d able to speak:



Ignore the buzzer and keep sleeping!

Checking e-mails, Twitter and Facebook




It is also hard for us to know where our readers come from, which is why we had the idea of creating this Google public map. The idea is to localize where web professionals are from and what their profession is.
Now, why not add yourself on the map (you need to be able to sign up with a google account) and include a few words about you such as your job title for example? To add a placemark, you need to click on “Edit” in the left column of the page and then use the Placeholder icon that will appear in the left upper area of the map. Please do not change the title and description of the map. And let’s see what this map looks like in a few days.
(al)
© Jessica Bordeau for Smashing Magazine, 2010. | Permalink | Post a comment | Add to del.icio.us | Digg this | Stumble on StumbleUpon! | Tweet it! | Submit to Reddit | Forum Smashing Magazine
Post tags: community, smashing
ForeUI is an amazing UI prototyping tool meant for designers, programmers and anyone who needs a desktop tool to create screen mockups for web or desktop applications. You can use ForeUI.com desktop app to create a prototype of an application or a website.
The need of using a prototyping tool is when you have to verify the design with your clients or colleagues and then start the development process. You can use the prototype to write the documentation before starting the development phase or perform usability testing before coding and so on.
ForeUI is available for Windows and MAC operating systems and the latest version of ForeUI (2.3.2) can be downloaded from this page
When you run the ForeUI desktop app, you see the following work interface:
The middle pane which is shown in white, acts as a board for holding all the elements of your mockup. You can drag and drop the different elements from the sidebar and adjust the position and styling of different elements as you want.
For example: I created a screen mock up of a simple HTML website by dragging and dropping the rectangle element from the sidebar. Following is a preview of the mockup:
Just double click an element from the left sidebar and it appears on the main pane for editing. Next, you can use your mouse to resize it or place it anywhere on the plot. The right sidebar lets you add style rules to the elements e.g adjusting the background color, position, border, width, height, layers and so on.
Here are all the properties of an element which you can tweak:
Next, I wanted to see how the prototype may look in the browser. ForeUI lets you export the mockup to image, PDF or DHTML formats, hence I chose the DHTML format and exported it in my desktop. Following is the result:
This is very useful, I can create the sample of a design and export the copy to PDF or DHTML formats. Then I can email the sample to my clients or developers and they can have a rough idea about my project.
The best part is that the mockup is Fidelity independent. You can always change the style by switching the UI theme and make adjustments as desired. Currently, ForeUI supports 5 UI themes – Windows XP, Windows 7, MAC OS X, Wireframing and Hand Drawing.
Changing the UI theme is very easy, all you have to do is select the theme from the UI theme dropdown as shown below:
The Action Editor : The Action editor in ForeUI lets you define the behaviour of each element in your plot. The behaviour can be a simple message, popup window, link or anything which you want the application to perform once the user interacts with the element.
To access the action editor, select an element and click the action button, shown by a flag:
This will open a pop up window where you can define the action of the element. Defining the action is fairly easy, you have to create a flowchart and add the logic and order of events in the flowchart.
For example: If on clicking a button, you want to show a dialog box containing a Yes / No button. If the user clicks the Yes button, the required action will be performed. If he clicks the No button, he will be returned to the current page.
In that case, you can create a simple If else conditional check and design the flow chart as follows:
Here is how the output will look like:
You can define more complex conditions and logics, this depends on what you want your prototype to perform once the user’s action triggers an event. The Action editor contains a lot of options to define conditional checking, adding different events e.g onclick, mouse hover and looping.
Once you are done with defining the logic and behavior of an element, you can run the simulation and your plot will run as a DHTML page in the browser.
This is really great, you can define how your application interacts with the user and do not have to code anything. Just create the mockup, add the rules and conditional checking and export it as a DHTML page. Then send it to your developers and ask them to do all the coding or design work.
You can also export the UI file of your plot and let your developers see the flowchart and the different order of events associated with a web element. The interactive design and flowchart model is really time saving.
Sharing Resources:
ForeUI supports packing a chosen part of your design as a custom element and exporting it. This is extremely useful when you want to share a part of your design or mockup with anyone.
Consider an example: You are designing a web application and want someone else to work on the site’s navigation. You have already designed the navigation and want the developer to add more features in it.
In that case, you can export the navigation as a custom element and send it to the developer. The developer can then import the custom element as a plot and customize it the way he wants. He can add more elements, events, conditional checking, modify the layout and colors and so on.
When he has finished modifying the custom element, he can export it and send it back to you. Then you can import the modified custom element in your prorotype.
The resource sharing feature is a lifesaver, you can divide the functional areas of your application to different developers. Let them develop the different elements on their own and then merge all the elements together in your prototype.
To export a custom element, click the “Resource sharing” button from the left sidebar. This will open a new popup window where you can sign in with your ForeUI account and share a resource with other users of the ForeUI comunity.
See Examples: At the ForeUI demo page, you can see some good examples of screen mockups and DHTML prototypes. Just click a thumbnail and the demo prototype will run in your browser.
ForeUI has an active community of users at ForeUI.net, where you can meet and interact with other people who are already using the ForeUI application. You can download or upload resources from the ForeUI community for Free, this includes custom elements, libraries and plots .If you have any problems or need any help, you can ask questions, leave comments or start a discussion.
More information about using ForeUI is available on the official documentation page.
The free version of ForeUI lets you test all the features for 15 days. If you seriously need a full featured prototyping tool, it’s worth giving ForeUI a try.
Brought To You By

Do you want to advertise here? Click to get more info…
The first image below clearly says that the story “$10M X Prize Announced for Solution to Gulf Oil Spill Crisis“ could not succeed when it came in the digg trending story this morning and digg failed it to get on the home page, as per the message says ” Failed! just like nu metal, this trend failed. It won’t be promoted. But it was not the case. So, what’s the case then? see the second image. I am not sure if it does matter but this story was submitted by Jay Adelson who worked as Digg’s CEO for five years and recently left out.
For those who don’t know what is digg trending story, click here to read in their own words.

Yes, in the image below digg says that story made popular 3 minutes ago which is weird, isn’t it? I dont understand that if the story was failed and won’t be promoted then how come it made popular.

This case forced me to think if digg algorithm is still alive or we are a part of community which is not credible anymore. Maybe it’s because that trending at digg.com is still in beta but they must consider this seriously. I am hoping Digg.com will not penalized us for bringing this case to the world.
Thanks to Chris who bring this in our knowledge and shared his latest experience with us.
Brought To You By

Do you want to advertise here? Click to get more info…
The updates didn’t add any new features, but they did add an important change to the code contained in each one. The full story on that is technical and likely to be quite boring (I’ll expand on this for those interested later in the post). The important bit is that I highly recommend those using Builder and/or any of the above-mentioned plugins upgrade their sites to these new versions.
Updating is important as some of the new features that will be released soon (such as the Builder Blocks that we discussed during yesterday’s iThemes.tv show) will only work properly if all of these updates are present on your system. In other words, if you update Builder to 2.4.15 but have an older version of Tabber Widget on your site, these new features will have a chance of not working properly. Again, please make sure that you upgrade Builder, Builder Style Manager, Builder SEO, and Tabber Widget.
I’m very sorry for this inconvenience. Please leave a comment if you have any questions or concerns.
For those that want to know the technical details, I am more than happy to share them.
The Builder, Builder Style Manager, Builder SEO Plugin, and Tabber Widget projects all have a shared set of code found in each project’s lib/classes directory. The lib/classes code library provides a robust set of functions and classes that makes development quicker and more reliable. For example, this library contain classes and functions that generate forms, process form data, provide versioned storage systems complete with upgrade abilities, handle files and images, offers a parent class that allows for rapid creation of new editors, etc. This central set of libraries started development with the Builder project and has grown to contain a wealth of valuable code that can be used for numerous projects (as none of the code is Builder-specific). Thus, this library has found its way into other projects.
For a couple of months, I’ve known of a serious problem with this code spreading to other projects: the fact that there is now a possibility of multiple versions of the code being present on the same system. This can be easily caused when more than one project that uses the library is present and only one of the projects is updated after a new library release. Since only one set of the code libraries can load, it was impossible to ensure that only the most current version of the libraries loaded. If the old set of libraries loaded, it could very easily cause the updated project code to fail.
These new releases contain a new set of the lib/classes code (version 1.2.0) which addresses this issue. Now, instead of a first come, first loaded process of deciding which library version loads, each project’s library registers itself. When all the plugins and the theme have loaded and registered their respective versions of the library code, a process runs that identifies the most current version of the library and loads only that one.
If you are interested in how this works, check out the load.php and init.php files in lib/classes of one of the updated projects. The init.php file is what is loaded when the current version is identified. Inside the init.php file, a function is defined that all the projects use to load that version’s file when needed.
Looks frustrating, isn’t it? You bought the second monitor to increase your productivity and make your work faster, not to shuffle numerous windows between monitors! Attaching the third monitor doesn’t help – even more screen estate, opened windows and time lost on routine window manipulations.
The right answer is following: to be efficient, multi-monitor computing requires specially designed user interface tools and utilities. Historically, Windows user interface was designed in a single-monitor era and haven’t changed significantly since then. Even the latest Windows 7 system, though introduced many smart updates in its UI, provided nothing new regarding the work with multi-display desktops.
Actual Multiple Monitors, a software utility by Actual Tools, has been developed to upgrade Windows user interface with all necessary tools and means and make the work with multiple monitors fast, pleasant and efficient.
The first thing you notice on a second display is its “emptiness”: there is no taskbar, no icons, no windows. Okay, windows can be dragged and new icons can be created there, but what about the taskbar? Your short research ends up with a disappointing result: Windows has no task management options on secondary displays. Yes, each time you need to activate a window minimized on a secondary monitor, to launch a new task from the Start menu, to access a background service’s icon in the notification area – you have to drag the mouse to the primary display and back.
Actual Multiple Monitors can emulate Windows Taskbar on all secondary monitors you have. Each such taskbar looks and works like a full replica of the main taskbar: it has the Start button, notification area and clock, it can display toolbars (like Quick Launch), it can be locked or hidden, and it even supports the new abilities presented in Windows 7: Pin and Peek.
Besides the regular features of the main taskbar, Multi-monitor Taskbar offers some advanced abilities.
![]()
Most of them are available in each secondary taskbar’s context menu:
![]()
First, each taskbar (including the primary one) can display just the tasks running on its host monitor (so-called individual mode).
In other words, you can use each monitor for a separate activity, and applications from different monitors won’t be mixed up in the taskbar. However, if you need to manage all running tasks despite which monitor you are currently working with – each secondary taskbar can mirror the contents of the primary one (the mirror mode).
Second, you can move groups of windows between monitors in a single click using the special commands in the taskbar’s context menu. There are two basic actions: transfer all windows from one monitor to another (“Get…” and “Send…” commands) and collect windows from all monitors onto a certain one (“Gather all…” command). This may be useful for those who attach/detach certain displays frequently.
Finally, there are some usability features for versions older than Windows 7 or for visual themes other than Aero:
This small window is invisible most of the time and appears only when you press Alt-Tab, but it’s almost as important as the taskbar. Despite this, Windows displays the Task Switcher on the primary display only, too, as in case with the taskbar. That means you need to switch your attention from the display you are currently working with to the primary one and back. Though it’s faster than moving the mouse (as in taskbar case), but it’s also annoying and distractive.
Using Actual Multiple Monitors, you can clone the Task Switcher window on secondary displays and switch between tasks smoothly and conveniently on any monitor.
When you have more than one monitor displaying your Windows desktop, there appear some opportunities that were impossible or had no mean for a single monitor.
The first thing that immediately becomes obvious is the fast transfer of a particular window from one monitor to another. Dragging it with the mouse isn’t fast enough (at first; later, it becomes tedious and annoying). With Actual Multiple Monitors, you can put an additional button
onto each window’s title bar: click it – and window will jump instantly to the next monitor! Right click on this button pops up a menu with the list of monitors so that you can transfer a window to the exactly required one; the same menu is available in window’s context menu.
Also, the program provides special hotkeys – Move to Next Monitor (Win-/ by default) and Move to Previous Monitor (Win-Shift-/ by default).
The second thing is the ability to expand a window quickly to entire composite desktop, as the regular Maximize button does for a single monitor (in a multi-monitor desktop this button maximizes a window to its current monitor only). Actual Multiple Monitors offers you another special title button –
Maximize to Desktop. It works exactly as its name implies: first click on this button expands a window to desktop’s extent; second click restores window’s size and position.
![]()
This button also has the corresponding item in window’s context menu and the hotkey combination (Win-Num* by default).
No matter how large picture you put as desktop background – Windows still displays its top-left corner on each monitor; there are no options to make this picture span all monitors, as well as to set different backgrounds on different monitors. The same is true for screen savers: although some of them are able to span the entire multi-monitor desktop, there are still many screen savers that know nothing about multiple monitors.
Actual Multiple Monitors comes to the rescue in this situation too: with its help, you will be able to either set a single picture as background for the entire desktop or put different background pictures on different monitors.
![]()
The same extension is available for screen savers.
![]()
In addition, the background wallpaper extension supports the slideshow mode: you create a “playlist” of individual images and image folders, set the delay between slides – and the program will automatically rotate pictures from the playlist on the entire desktop’s background or just the backgrounds of specified monitors.
![]()
Sometimes the number of monitors connected to your system may vary. This situation is quite common for mobile computers (notebooks, netbooks, Tablet PCs) that can be connected to an external display, and for home media center PCs that are usually plugged to a high definition TV. Also, in some cases the need arises to change the entire desktop configuration: arrange monitors differently, alter their properties (resolution, color depth, etc.) and so on. Each time such need arises, you have to open the Display Settings dialog and adjust all required options separately. The more often it happens – the more time you spend on changing your desktop configuration.
Actual Multiple Monitors gives you the tools to make such changes in about two clicks. Right-click the program’s icon in the system tray to invoke its context menu:
![]()
The “Manage Secondary” submenu lets you switch secondary displays on/off either one at a time or all at once (please note that “Disable all…”/”Enable all…” commands have their corresponding keyboard shortcuts). In the related “Set Primary” submenu you can quickly switch the primary display. And the “Desktop Profiles” submenu lets you activate or configure so-called desktop profiles.
Desktop profiles are named groups of various settings applied at once when the profile is activated. Each profile includes the number of displays, their relative layout and per display information: resolution, color depth, refresh rate, is display enabled, is display primary.
![]()
You can create as many profiles as you need and switch between various desktop configurations in a flash: either via above-mentioned context menu or by pressing the keyboard shortcut to invoke the “Desktop Profiles” submenu at the mouse pointer.
![]()
If you often change the configuration of your desktop, you may notice that sometimes Windows fails to keep the order of desktop icons: their habitual layout becomes garbled, and you have to restore it manually. The more icons you have – the more annoying each such situation is. Actual Multiple Monitors can save the current layout of your desktop icons for the current desktop configuration and then restore this layout automatically in a single click – see the “Save/Restore desktop icons order” commands in the context menu above (both commands also can be invoked via hotkeys).
Windows user interface for a multi-monitor environment is incomplete and may significantly reduce the actual benefit from the expanded screen real estate. Actual Multiple Monitors supplies it with all goods (multi-monitor taskbar, advanced window manipulations, extended options for wallpapers and screen savers, special desktop control utilities) and hence, appears to be a must-have program for any user who wants to use multiple displays at full extent.
Brought To You By

Do you want to advertise here? Click to get more info…
The challenge of coming up with great posts has challenged bloggers for years, although there is a great way that you can nearly eliminate this problem with just a few visits to other websites.

The most popular content is ranked by users on sites like Digg, TweetMeme (for Twitter), and Like Button (for Facebook), giving you a glimpse into the most popular content on the Web. So much content is being shared at any time that even these sites can be difficult to use when you need new topics to write about.
For the most part, shared content revolves around two main types: original content, such as news stories, blog posts, and photographs, while the second group revolves around collections and remixes, ranging from list posts to edited photographs and remixed songs.
I’ll take a quick look at the front page of Digg and then we’ll look at how you can apply these trends to come up with interesting blog posts.
Even if you don’t have a news blog, it can be a good idea to base your new posts on the current trends. Contrary to popular belief, some of the most trafficked posts deal with current events, rather than timeless content. Sure, the timeless content will still have rewards down the road, but that is only if it becomes popular today, is linked to frequently, and then is ranked well in search engines for a wide array of terms.
A popular post format working its way across the social networking sites right now is the “in-depth” post, with analysis of current trends, such as the Facebook debacle. Readers want to know how certain events will impact their life, rather then just the news, which can be found on the original site.
While there has certainly been debate about the format of list posts, these posts are popular and will remain so. They have always been popular, even in the days of newspapers and print. They grab a visitor’s attention and can become popular in a matter of minutes. Putting the time into researching the posts is ideal, and it’ll result in a post that will be linked to across social networking sites and relevant blogs.
The key is creating unique content. Until you have become as large as some of the most popular blogs, you’ll need to set yourself apart in some way or another. The key to doing this is to create content that few other sites have, and this may include breaking news. Scour the web for hot trends and then see if any new developments have taken place. Starting a really local blog can draw in the traffic levels that will let you earn an income – al inspired by sites like Topix.
Other Ideas to Keep in Mind:
No matter what type of site you run, keeping tabs on the popular social networking sites and the directories connected to them will allow you to constantly see where markets are heading. Even if you have a blog about an extremely specific topic, you can still perform searches on these sites and see how well other posts have done.
Remember, the only thing that matters in all this si that your site stands out. Focus solely on what your visitors are looking for even before they tell you. Stay involved in your niche and create a community around your site to maximize the time you spend writing posts.
The Help documentation provided within Office2 Pro includes some guidance about configuring your Google account within the application, but the steps are not thorough or very clear.
Make sure you are viewing the application in LANDSCAPE mode to begin. Step 1 is to click the BACK button.
Step 2: Click the EDIT button.
Step 3: Click ADD SERVICE.
Step 4: Click GOOGLE DOCS to add it as a service.
Step 5: Enter your Google credentials, and a name for this ‘service.’
Step 6: Click DONE.
Step 7: Click on the name you provided as a description for your Google account.
Step 8: Click on an existing document you want to edit, or the “+” symbol to add a new document.
Step 9: Choose to create a word processing document or a spreadsheet /workbook. (If you noticed the misspelling in the image below, rest assured I DID correct “analysis” in the top document. That was one shared with my by someone else.
)
Step 10: Enter a new name for your document.
“Unknown errors” unfortunately appear to be common with this version of Office2 Pro and Google Docs.
Step 12: Select text as desired and choose font type and text size from the menu bar, using your finger.
Step 13: Select formatting options as desired, including bulleted or numbered lists. Note the formatting menu bar can be “slid” to reveal a second set of formatting options.
Step 14: Since a SAVE button is not available, you must click CLOSE to save the document.
Step 15: “Unknown errors” are common, so save often.
I was able to do SOME editing on a Google Doc last Friday using Office2 Pro, but overall the experience was very frustrating and not nearly as productive as I’d hoped it would be because of frequent “unknown errors.”
I hope the application will be updated soon and this buggy behavior with Google Docs will be fixed. It’s GREAT the application developers are working to create an iPad environment which will enable editing for Google Doc word processing and spreadsheet files.
Once that is possible in more seamless way, if Apple makes the iPad Keynote application responsive to the Bluetooth keyboard’s arrow keys to wirelessly advance slides I may be able to leave my laptop at home when I travel for presentations! I’d like to become an “iPad only” presenter and conference session blogger, and trade in my 10 lbs+ laptop for the 1.5 lb iPad.
Technorati Tags:
doc, google, ipad, pro, docs, office2, edit, word, processing, excel, file
WordPress’ popularity has grown exponentially as of late. This rise in popularity is due in part to WordPress’ custom fields. Custom fields allow you to add little bits of data to posts. They have changed the way people look at WordPress. A couple of years ago, WordPress was a blogging platform — a good one, but a blogging platform nonetheless. Now it’s widely considered to be an excellent simple content management system. How did it evolve so quickly? Custom fields, that’s how.
How exactly did these bits of data transform WordPress? The fields could initially include the weather — as the codex points out — the temperature and various other not-particularly-useful things. And that was the story for a while. Then people started to realize that they could use the custom fields to store URLs of images. They could then pull these images to the home page to create magazine-style layouts. These magazine themes, as they became known, evolved, and eventually you were able to pull images automatically from posts. You can draw a direct line from WordPress’ popularity to the magazine themes to custom fields.
[Offtopic: by the way, did you know that Smashing Magazine has one of the most influential and popular Twitter accounts? Join our discussions and get updates about useful tools and resources — follow us on Twitter!]
In order to do more complicated things, you’ll need to understand the syntax. Creating a custom field is easy: it requires a name and a value. The name is constant, but the value can change with each post.
A real-world example: let’s say you run a blog about cameras. You have categories set up for each type of post (“Review,” “New,” etc.), and you tag the post with the manufacturer’s name. But you want to display the price and specifications of the camera. This is as easy as creating a new custom field with the name Camera_Specs and then typing the info into the value box. Click the “Add” button and you will have added the custom field to the post.
Displaying the field on the page is simple, too. In the single.php file, add the following code:
<?php echo get_post_meta($post->ID, "Camera_Specs", true); ?>
(You might want to wrap this in a paragraph, ordered list or the like. You can use HTML in the value of the field.)
Custom fields can be conditional, too. We can display a camera’s specs or, if that isn’t available, some generic text.
<?php $camera_specs = get_post_meta($post->ID, 'Camera_Specs', true);
if ($camera_specs) {
?>
<?php echo $camera_specs; ?>
<?php } else { ?>
<p>No specification available.</p>
<?php } ?>
That’s the general syntax, and now the only limit is your imagination!
Post titles are usually fairly boring. You’re limited to text. Links aren’t possible, nor is HTML. Well, not anymore. Custom fields to the rescue!
Using a conditional statement and custom fields, adding any HTML to your posts’ titles is now possible. (This won’t work with RSS feeds or the like, but it works great for any titles on the blog itself.) We’ll use the custom field Post-Title:
You can add any HTML you like to your posts’ titles. Implementing it on your blog is easy, too. You’ll have to use the following code on all pages on which titles are displayed: the home page, archives, current posts, etc. The following snippet looks for the custom field and falls back on the_title:
<?php $post_title = get_post_meta($post->ID, 'Post-Title', true);
if ($post_title) {
?>
<h2><?php echo $post_title; ?></h2>
<?php } else { ?>
<h2><?php the_title(); ?></h2>
<?php } ?>
An easy yet effective way to improve your website.
WordPress displays posts through something called a loop. Another WordPress function, query_posts, allows you to choose exactly which posts are displayed in your loop. One parameter lets you display only posts that have a custom field and/or that have a specific custom field value. Going back to our camera website, we could display only posts that have the custom field Camera_Specs:
query_posts('meta_key=Camera_Specs');
If we wanted to display only cameras that had 10 megapixels (and if all posts had the custom field Camera_Specs_Pixels that specified the value of the number of megapixels), we could do so with the following:
query_posts('meta_key=Camera_Specs_Pixels&meta_value=10');
You may want to do this on a custom page template. If so, just add the following to the top of the file and name it appropriately (e.g. camera-specs-pixels.php):
<?php /*Template Name: Camera Specs Pixels */?>
To make your new page template show up, create a new page, and then in the drop-down on the right, choose the page template you’ve just created. Publish the post, and you’re done!
WordPress 2.7 introduced the post_class function. This allows you to apply specific CSS classes to posts (thus giving them unique designs). Guess what? You can use custom fields to apply particular classes!
This one is a bit more involved. First, open your functions.php file and add the following code:
function shiftnews_post_class($classes) {
global $post;
$sn_post_class_array = array (
get_the_author_meta('display_name'),
get_post_meta($post->ID, 'post-class', true)
);
$classes[] = implode(" ", $sn_post_class_array);
return $classes;
}
You’ll then need to edit your single.php file, adding <?php post_class(shiftnews_post_class()); ?> to a DIV that wraps your content. Using the custom field post-class, you can then type in CSS classes (e.g. flower-bg or blue-content, which would apply the classes .flower-bg or .blue-content), thus adding them to the post.
The possibilities here are inspiring, and this is quite possibly the best way to create a unique post design for WordPress.

You could take this even further by allowing users to choose a background image through custom fields. Of course, you could just resize the image to 1920×1200, upload it and copy the URL into a custom field, ‘background’ and then put the following code in your header:
<?php if (is_page() || is_single()) {
<?php $background = get_post_meta($post->ID, 'background', true);
if ($background) {
?>
<style type="text/css">body{ url(<?php echo $background; ?>) no-repeat fixed; }</style>
<?php }
}?>
But that would be a pain to do every single time you just wanted to change the background image. There is an easy way to do it: upload an image, copy the URL into a custom field and then use a script to resize the image and set it as the background.
First thing to do is to upload an image. We’re going to be resizing it to 1920px (although depending on your audience you may want to use a higher/lower resolution) so anything that’s 1200px wide or above should look fine.
Copy the relative URL of the image (ie /wp-content/… , not http://yoursite.com/wp-content/) into a custom field called ‘background’ and click ‘add custom field’. Next, we need something to resize the images with. We’ll be using timthumb. Upload it to /yourtheme/timthumb/ and we’re ready to go!
Open up your header once again and add (below your theme’s stylesheet) the following:
<?php if (is_page() || is_single()) {
<?php $background = get_post_meta($post->ID, 'background', true);
if ($background) {
?>
<style type="text/css">background: url(<?php bloginfo('template_url'); ?>/timthumb/timthumb.php?w=1920&zc=1&src=<?php echo $background; ?>) fixed no-repeat;</style>
<?php }
}?>
What that does is takes the image from the custom field and then runs it through timthumb so it gets resized to fill the entire screen, even on large monitors (the image then gets cached, so it is only generated once). The resized image is then displayed as the background of the post.
If you’re having problems, make sure you’ve got the relative URL and not the absolute URL of the image, it is hosted on your server (you’re not hotlinking!) and that you have the file permissions set correctly (as shown in the timthumb wiki). This is one of my favourite things to do with custom fields as not only is it easy to do, but it’s also very effective in differentiating different blog posts; this technique is used to great effect on Nometet.com.
The “All in One SEO Pack” is consistently one of the most popular plug-ins for WordPress. It allows you to do things like specify your own title tag or meta description. It is powered by custom fields, meaning you can recreate it in your theme.
Start by adding the following code to your theme’s title tag:
<?php if ( is_single() || is_page() ) { ?><?php $title = get_post_meta($post->ID, 'Title', true); if ($title) { ?>
<?php echo $title; ?> | <?php bloginfo('name'); ?>
<?php } else { ?>
<?php wp_title(''); ?> | <?php bloginfo('name'); ?>
<?php } ?>
<?php } ?>
Now, when a page or post is displayed, WordPress will look for the custom field Title. If it exists, its contents will be displayed; if it doesn’t, then the post’s title will be displayed. To use this new-found power, create the custom field Title and make its value what you want to be displayed in the title tag (note that | [Blog name] will be added).
You can apply the same idea to other elements, such as the description tag:
<?php if (is_single() || is_page() ) : if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<meta name="description" content="<?php $description = get_post_meta($post->ID, 'Description', true); if ($description) { ?><?php echo get_post_meta($post->ID, "Description", true); ?>
<?php } else { ?><?php the_excerpt_rss(); ?><?php } ?>" />
<?php endwhile; endif; elseif(is_home()) : ?>
<meta name="description" content="<?php bloginfo('description'); ?>" />
<?php endif; ?>
The code above should replace the entire description tag and allow you to use the custom field Description to display the contents of the description tag. If the custom field does not exist, then the excerpt is used on posts and pages, and the blog’s description (which you set when you installed WordPress) is used on the home page.
Read more on the topic in the article WordPress SEO: The Definitive Guide To Higher Rankings For Your Blog.
Custom fields are very powerful, and the only limit is your imagination! As we’ve seen in this post, you can do some really awesome things with WordPress’ custom fields. They can improve both your blog and its ranking in search engines. Enjoy!
If you’d like to do some further reading:
The possibilities for this are inspiring, and this is quite possibly the best way to create a unique post design for WordPress.
Of course, the other option is to use custom fields to include a style sheet that is specific to the post or even just to use inline styling.
You can add a style sheet to a post with a custom field value quite easily. First, add the following code to the header.php file, after your theme’s style sheet loads:
<?php if (is_page() || is_single()) {
<?php $stylesheet = get_post_meta($post->ID, 'Stylesheet', true);
if ($stylesheet) {
?>
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?><?php echo $stylesheet; ?>.css" type="text/css" media="screen,projection,tv" /></h2>
<?php }
}?>
This tells WordPress to look for the custom field Stylesheet on posts and pages. All you’ve got to do is enter the name of the style sheet (so if it’s blue.css, just enter the value blue) and upload it to your theme’s directory.
A whole new style sheet might be overkill in some cases, though. If you’re changing just one or two styles, then inline styling might be the way to go. This is just as easy: paste the following code into your header.php file, again after your theme’s style sheet loads:
<?php if (is_page() || is_single()) {
<?php $styles = get_post_meta($post->ID, 'Styles', true);
if ($styles) {
?>
<style type="text/css"><?php echo $styles; ?></style>
<?php }
}?>
This piece of code looks for the custom field Styles; put in it any styling you want to apply only to that post. For example:
body{
color:#000;
background:#fff;
}
There’s something for everyone here, so you can start to quickly create unique post designs however you prefer! You might want to look at Smashing Magazine’s previous post about custom fields as well.
(al)
© Alex Denning for Smashing Magazine, 2010. | Permalink | 33 comments | Add to del.icio.us | Digg this | Stumble on StumbleUpon! | Tweet it! | Submit to Reddit | Forum Smashing Magazine
Post tags:
I’ve been writing JavaScript code for much longer than I care to remember. I am very excited about the language’s recent success; it’s good to be a part of that success story. I’ve written dozens of articles, book chapters and one full book on the matter, and yet I keep finding new things. Here are some of the “aha!” moments I’ve had in the past, which you can try out rather than waiting for them to come to you by chance.
[Offtopic: by the way, did you know that Smashing Magazine has one of the most influential and popular Twitter accounts? Join our discussions and get updates about useful tools and resources — follow us on Twitter!]
One of the things I love most about JavaScript now is shortcut notations to generate objects and arrays. So, in the past when we wanted to create an object, we wrote:
var car = new Object(); car.colour = 'red'; car.wheels = 4; car.hubcaps = 'spinning'; car.age = 4;
The same can be achieved with:
var car = {
colour:'red',
wheels:4,
hubcaps:'spinning',
age:4
}
Much shorter, and you don’t need to repeat the name of the object. Right now, car is fine, but what happens when you use invalidUserInSession? The main gotcha in this notation is IE. Never ever leave a trailing comma before the closing curly brace or you’ll be in trouble.
The other handy shortcut notation is for arrays. The old school way of defining arrays was this:
var moviesThatNeedBetterWriters = new Array( 'Transformers','Transformers2','Avatar','Indiana Jones 4' );
The shorter version of this is:
var moviesThatNeedBetterWriters = [ 'Transformers','Transformers2','Avatar','Indiana Jones 4' ];
The other thing about arrays is that there is no such thing as an associative array. You will find a lot of code examples that define the above car example like so:
var car = new Array(); car['colour'] = 'red'; car['wheels'] = 4; car['hubcaps'] = 'spinning'; car['age'] = 4;
This is not Sparta; this is madness—don’t bother with this. “Associative arrays” is a confusing name for objects.
Another very cool shortcut notation is the ternary notation for conditions. So, instead of the following…
var direction;
if(x < 200){
direction = 1;
} else {
direction = -1;
}
… You could write a shorter version using the ternary notation:
var direction = x < 200 ? 1 : -1;
The true case of the condition is after the question mark, and the other case follows the colon.
Before I discovered JSON to store data, I did all kinds of crazy things to put content in a JavaScript-ready format: arrays, strings with control characters to split, and other abominations. The creation of JSON by Douglas Crockford changed all that. Using JSON, you can store complex data in a format that is native to JavaScript and doesn’t need any extra conversion to be used immediately.
JSON is short for “JavaScript Object Notation” and uses both of the shortcuts we covered earlier.
So, if I wanted to describe a band, for example, I could do the following:
var band = {
"name":"The Red Hot Chili Peppers",
"members":[
{
"name":"Anthony Kiedis",
"role":"lead vocals"
},
{
"name":"Michael 'Flea' Balzary",
"role":"bass guitar, trumpet, backing vocals"
},
{
"name":"Chad Smith",
"role":"drums,percussion"
},
{
"name":"John Frusciante",
"role":"Lead Guitar"
}
],
"year":"2009"
}
You can use JSON directly in JavaScript and, when wrapped in a function call, even as a return format of APIs. This is called JSON-P and is supported by a lot of APIs out there. You can use a data endpoint, returning JSON-P directly in a script node:
<div id="delicious"></div><script>
function delicious(o){
var out = '<ul>';
for(var i=0;i<o.length;i++){
out += '<li><a href="' + o[i].u + '">' +
o[i].d + '</a></li>';
}
out += '</ul>';
document.getElementById('delicious').innerHTML = out;
}
</script>
<script src="http://feeds.delicious.com/v2/json/codepo8/javascript?count=15&callback=delicious"></script>
This calls the Delicious Web service to get my latest JavaScript bookmarks in JSON format and then displays them as an unordered list.
In essence, JSON is probably the most lightweight way of describing complex data—and it runs in a browser. You can even use it in PHP using the json_decode() function.
One thing that amazed me is how much easier my life got once I read up thoroughly on the math and string functions of JavaScript. You can use these to avoid a lot of looping and conditions. For example, when I had the task of finding the largest number in an array of numbers, I used to write a loop, like so:
var numbers = [3,342,23,22,124];
var max = 0;
for(var i=0;i<numbers.length;i++){
if(numbers[i] > max){
max = numbers[i];
}
}
alert(max);
This can be achieved without a loop:
var numbers = [3,342,23,22,124];
numbers.sort(function(a,b){return b - a});
alert(numbers[0]);
Notice that you cannot use sort() on a number array because it sorts lexically. There’s a good tutorial on sort() here in case you need to know more.
Another interesting method is Math.max(). This one returns the largest number from a list of parameters:
Math.max(12,123,3,2,433,4); // returns 433
Because this tests for numbers and returns the largest one, you can use it to test for browser support of certain properties:
var scrollTop= Math.max( doc.documentElement.scrollTop, doc.body.scrollTop );
This works around an Internet Explorer problem. You can read out the scrollTop of the current document, but depending on the DOCTYPE of the document, one or the other property is assigned the value. When you use Math.max() you get the right number because only one of the properties returns one; the other will be undefined. You can read more about shortening JavaScript with math functions here.
Other very powerful functions to manipulate strings are split() and join(). Probably the most powerful example of this is writing a function to attach CSS classes to elements.
The thing is, when you add a class to a DOM element, you want to add it either as the first class or to already existing classes with a space in front of it. When you remove classes, you also need to remove the spaces (which was much more important in the past when some browsers failed to apply classes with trailing spaces).
So, the original function would be something like:
function addclass(elm,newclass){
var c = elm.className;
elm.className = (c === '') ? newclass : c+' '+newclass;
}
You can automate this using the split() and join() methods:
function addclass(elm,newclass){
var classes = elm.className.split(' ');
classes.push(newclass);
elm.className = classes.join(' ');
}
This automatically ensures that classes are space-separated and that yours gets tacked on at the end.
Events make Web apps work. I love events, especially custom events, which make your products extensible without your needing to touch the core code. The main problem (and actually one of its strengths) is that events are removed from the HTML—you apply an event listener to a certain element and then it becomes active. Nothing in the HTML indicates that this is the case though. Take this abstraction issue (which is hard for beginners to wrap their heads around) and the fact that "browsers" such as IE6 have all kind of memory problems and too many events applied to them, and you'll see that not using too many event handlers in a document is wise.
This is where event delegation comes in. When an event happens on a certain element and on all the elements above it in the DOM hierarchy, you can simplify your event handling by using a single handler on a parent element, rather than using a lot of handlers.
What do I mean by that? Say you want a list of links, and you want to call a function rather than load the links. The HTML would be:
<h2>Great Web resources</h2> <ul id="resources"> <li><a href="http://opera.com/wsc">Opera Web Standards Curriculum</a></li> <li><a href="http://sitepoint.com">Sitepoint</a></li> <li><a href="http://alistapart.com">A List Apart</a></li> <li><a href="http://yuiblog.com">YUI Blog</a></li> <li><a href="http://blameitonthevoices.com">Blame it on the voices</a></li> <li><a href="http://oddlyspecific.com">Oddly specific</a></li> </ul>
The normal way to apply event handlers here would be to loop through the links:
// Classic event handling example
(function(){
var resources = document.getElementById('resources');
var links = resources.getElementsByTagName('a');
var all = links.length;
for(var i=0;i<all;i++){
// Attach a listener to each link
links[i].addEventListener('click',handler,false);
};
function handler(e){
var x = e.target; // Get the link that was clicked
alert(x);
e.preventDefault();
};
})();
This could also be done with a single event handler:
(function(){
var resources = document.getElementById('resources');
resources.addEventListener('click',handler,false);
function handler(e){
var x = e.target; // get the link tha
if(x.nodeName.toLowerCase() === 'a'){
alert('Event delegation:' + x);
e.preventDefault();
}
};
})();
Because the click happens on all the elements in the list, all you need to do is compare the nodeName to the right element that you want to react to the event.
Disclaimer: while both of the event examples above work in browsers, they fail in IE6. For IE6, you need to apply an event model other than the W3C one, and this is why we use libraries for these tricks.
The benefits of this approach are more than just being able to use a single event handler. Say, for example, you want to add more links dynamically to this list. With event delegation, there is no need to change anything; with simple event handling, you would have to reassign handlers and re-loop the list.
One of the most annoying things about JavaScript is that it has no scope for variables. Any variable, function, array or object you define that is not inside another function is global, which means that other scripts on the same page can access—and will usually override— them.
The workaround is to encapsulate your variables in an anonymous function and call that function immediately after you define it. For example, the following definition would result in three global variables and two global functions:
var name = 'Chris';
var age = '34';
var status = 'single';
function createMember(){
// [...]
}
function getMemberDetails(){
// [...]
}
Any other script on the page that has a variable named status could cause trouble. If we wrap all of this in a name such as myApplication, then we work around that issue:
var myApplication = function(){
var name = 'Chris';
var age = '34';
var status = 'single';
function createMember(){
// [...]
}
function getMemberDetails(){
// [...]
}
}();
This, however, doesn’t do anything outside of that function. If this is what you need, then great. You may as well discard the name then:
(function(){
var name = 'Chris';
var age = '34';
var status = 'single';
function createMember(){
// [...]
}
function getMemberDetails(){
// [...]
}
})();
If you need to make some of the things reachable to the outside, then you need to change this. In order to reach createMember() or getMemberDetails(), you need to return them to the outside world to make them properties of myApplication:
var myApplication = function(){
var name = 'Chris';
var age = '34';
var status = 'single';
return{
createMember:function(){
// [...]
},
getMemberDetails:function(){
// [...]
}
}
}();
// myApplication.createMember() and
// myApplication.getMemberDetails() now works.
This is called a module pattern or singleton. It was mentioned a lot by Douglas Crockford and is used very much in the Yahoo User Interface Library YUI. What ails me about this is that I need to switch syntaxes to make functions or variables available to the outside world. Furthermore, if I want to call one method from another, I have to call it preceded by the myApplication name. So instead, I prefer simply to return pointers to the elements that I want to make public. This even allows me to shorten the names for outside use:
var myApplication = function(){
var name = 'Chris';
var age = '34';
var status = 'single';
function createMember(){
// [...]
}
function getMemberDetails(){
// [...]
}
return{
create:createMember,
get:getMemberDetails
}
}();
//myApplication.get() and myApplication.create() now work.
I’ve called this “revealing module pattern.”
Whenever I've written JavaScript and given it to the world, people have changed it, usually when they wanted it to do things that it couldn't do out of the box—but also often because I made it too hard for people to change things.
The workaround is to add configuration objects to your scripts. I’ve written about JavaScript configuration objects in detail, but here’s the gist:
configuration.Most of the time you can do this as a last step in the coding process. I’ve put together an example in “Five things to do to a script before handing it over to the next developer.”
In essence, you want to make it easy for people to use your code and alter it to their needs. If you do that, you are much less likely to get confusing emails from people who complain about your scripts and refer to changes that someone else actually did.
One of the main things I learned from all my years with JavaScript is that it is a great language with which to make interactive interfaces, but when it comes to crunching numbers and accessing data sources, it can be daunting.
Originally, I learned JavaScript to replace Perl because I was sick of copying things to a cgi-bin folder in order to make it work. Later on, I learned that making a back-end language do the main data churning for me, instead of trying to do all in JavaScript, makes more sense with regard to security and language.
If I access a Web service, I could get JSON-P as the returned format and do a lot of data conversion on the client, but why should I when I have a server that has a richer way of converting data and that can return the data as JSON or HTML… and cache it for me to boot?
So, if you want to use AJAX, learn about HTTP and about writing your own caching and conversion proxy. You will save a lot of time and nerves in the long run.
When I started Web development, the battle between using document.all and using document.layers as the main way to access the document was still raging. I chose document.layers because I liked the idea of any layer being its own document (and I had written more than enough document.write solutions to last a lifetime). The layer model failed, but so did document.all. When Netscape 6 went all out supporting only the W3C DOM model, I loved it, but end users didn't care. End users just saw that this browser didn't show the majority of the Internets correctly (although it did)—the code we produced was what was wrong. We built short-sighted code that supported a state-of-the-art environment, and the funny thing about the state of the art is that it is constantly changing.
I’ve wasted quite some time learning the ins and outs of all of the browsers and working around their issues. Doing this back then secured my career and ensured that I had a great job. But we shouldn’t have to go through this trial by fire any longer.
Libraries such as YUI, jQuery and Dojo are here to help us with this. They take on the problems of browsers by abstracting the pains of poor implementation, inconsistencies and flat-out bugs, and relieve us of the chore. Unless you want to beta test a certain browser because you’re a big fan, don’t fix browser issues in your JavaScript solutions, because you are unlikely to ever update the code to remove this fix. All you would be doing is adding to the already massive pile of outdated code on the Web.
That said, relying solely on libraries for your core skill is short-sighted. Read up on JavaScript, watch some good videos and tutorials on it, and understand the language. (Tip: closures are God’s gift to the JavaScript developer.) Libraries will help you build things quickly, but if you assign a lot of events and effects and need to add a class to every HTML element in the document, then you are doing it wrong.
In addition to the resources mentioned in this article, also check out the following to learn more about JavaScript itself:
You may be interested in the following related posts:
(al)
© Christian Heilmann for Smashing Magazine, 2010. | Permalink | 60 comments | Add to del.icio.us | Digg this | Stumble on StumbleUpon! | Tweet it! | Submit to Reddit | Forum Smashing Magazine
Post tags: javascript, js
We do a lot of live shows and online webinar training where we often have to translate what time it is for our customers in different time zones across the world.
If you have an international business, you know how frustrating this can be for you and your clients.
For example, we’re in Central Time Zone … so naturally we do all our online events based on that. But typically, someone from the east or west coast or Australia (and even one time in Egypt) will ask what time for them that is.
I just found that you can get the current time in any location using Google.
Simply type in: “time [location]“
For example, we’re in Oklahoma City. So you would search “time Oklahoma city” ….
Hope this helps you!
[ Find out what time and date it is for iThemes here ]
Found via 10 simple Google search tricks