Partition a Fusion drive

By (author unknown), MacOSXHints.comOctober 25, 2012 at 10:30AM

This is less of a hint than a heads up. I was chatting with Rob Griffiths yesterday, the creator of this web site, wondering if one can partition a Fusion drive. It turns out that you can, but only the hard drive part of it. This, and many other questions, are addressed in this Apple technical note, which is worth reading. The Fusion drive is a new technology, and has certain limitations because of the way it works, but it can be useful to see what these limitations are.

Republican Voter Suppression App Designed By The Onion

By Gregory Ferenstein, TechCrunchOctober 24, 2012 at 05:04PM

Screen shot 2012-10-24 at 1.29.16 PM

Intimidating voters at the polls is so 19th century. And, now that courts continue to overturn Republican voter ID laws, based on the fact that just 10 incidences of voter fraud in the last decade doesn’t justify disenfranchising thousands of minority voters without a driver’s license, what is the GOP to do? Thankfully, America’s #1 fake news site has reimagined voter suppression for the 21st century, with a smartphone app that automatically applies time-tested voter intimidation to dark-skinned voters. Check out their concept video at the end of this post.

**Note: For all of those who are about to freak out in the comment section, this video is an obvious joke. Politics gets way (way) too serious sometimes and it’s good to take a deep breath and laugh. For the record, TechCrunch posts tech-related, positive-leaning stories about both parties in equal numbers, and we’ve been especially vigilant at dispelling the myth of Republicans as the luddite party (more here).

That said, enjoy:

Airbus bringing supply chain hub to Ohio

By Evan Weese, Columbus Business News – Local Columbus News | Business First of ColumbusOctober 25, 2012 at 07:27AM

Airbus Americas plans to establish aerospace suppliers in Dayton, aimed at creating a centralized Ohio Materials Manufacturing Technology Hub, the Dayton Business Journal reports.

Sen. Sherrod Brown was on hand for the announcement Wednesday in Columbus that Airbus would partner with the National Composite Center in Kettering and the Dayton Development Coalition.

Airbus, which is headquartered in Toulouse, France, is one of the two dominant global manufacturers of large commercial airplanes.

Morning…

How to Ease Into a Standing Desk Routine

By Thorin Klosowski, LifehackerOctober 24, 2012 at 10:30AM

How to Ease Into a Standing Desk RoutineStanding desks are a great way to get off your chair all day long and combat the negative effects of sitting. But it’s not exactly easy to stand all day long. Wirecutter suggests starting small, and working your way up from there.

Wirecutter’s suggestion is that instead of diving into a standing desk right away, you ease yourself into it over time. Start by just standing more throughout the day: commit to one task daily where you stand (phone calls, email, etc), and stand during breaks and meetings. From there, get yourself a cheap standing desk (you have tons of cheap options), and then commit to standing for one hour a day for the first week. Then gradually increase that over time.

If you’re intrigued by the idea of a standing desk, but don’t want to jump in head first (which also works just fine), Wirecutter’s suggestion is certainly an easier option. In the end it’s all about what works best for you: easing in or quitting sitting cold turkey. Head over to Wirecutter for their full guide to easing into it, including a few more suggestions for desk options once you get to the point where you’re confident in making the change.

How to stand (at your desk) | Wirecutter

Photo by John M.

Revealed: World Technology Network’s innovators of 2012

By James Holloway, Gizmag Emerging Technology MagazineOctober 24, 2012 at 11:38AM

Gizmag reveals the winners of the World Technology Summit & Awards 2012 (Photo: Ben Chau)

The World Technology Network summoned leading thinkers to New York’s TIME Conference Center on Monday and Tuesday to announce the winners of its 2012 World Technology Summit & Awards. The awards showcase the work of innovators across a diverse array of industry sectors and scientific fields. Gizmag reveals the list of winners, which includes no shortage of familiar faces… Continue Reading Revealed: World Technology Network’s innovators of 2012

Section: Inventors and Remarkable People

Tags: , , , , , , , ,

Related Articles:

Getting a New Computer Or Reinstalling Windows? Make a List Of Your License Keys

By Tina Sieber, MakeUseOfOctober 24, 2012 at 02:00PM

store license keys The biggest hassle of setting up a new system is re-installing and re-configuring software. What can make matters worse is if you discover halfway through that you don’t have a copy of the license key to some of your programs. Unless you manage to find a record in your emails or in your account at the manufacturer’s website, your only hope will be the support line. Save yourself a headache and store a list of your license keys for emergencies.

There are several free programs that can reveal product keys of your Microsoft and third-party software. However, be prepared to try and use more than one program to retrieve the licenses of all your commercial programs, as most free tools come with limitations.

NirSoft ProduKey

ProduKey should be your tool of choice if you need to recover Microsoft license keys. The tool can identify serials for Microsoft Office, Windows, SQL Server, and Exchange Server. Like all of NirSoft’s applications, ProduKey is a portable app. I have previously introduced this app: 3 Ways To Recover Serial Numbers In Windows.

store license keys

To my surprise, ProduKey did not find the key for my Windows 7 installation. If you are running into this issue, try the following program.

SIW – System Information for Windows

SIW is a monster of a tool. It will give you an overview of your entire system specs and also has a section for licenses. When you try to download the tool, be sure to click the right link. You will see the Home Edition is listed below the pro versions and the download link is nested between ads.

manage license keys

After installing the program and allowing it to finish its first scan, switch to Licenses under the Software header in the left pane. This successfully revealed all licenses for me.

manage license keys

A similar and often recommended tool is Belarc Advisor. However, while it does have a nice section for software licenses in its report, it did not reveal the key for Windows 7.

Magical Jelly Bean Keyfinder

This used to be one of the best tools to gather and store license keys. However, the free version now is very limited and does not reveal serials of Adobe CS2-CS6 products, Windows 7, Windows 8, and Office 2010. In my eyes, this makes Magical Jelly Bean Keyfinder a little useless, as those are the most commonly purchased professional programs. Of course you can upgrade to Recover Keys, a paid version, which supports more than 10 times the programs.

However, if you need the license keys of other programs or if you want to recover serials from a Windows installation that no longer boots, Magical Jelly Bean Keyfinder may still be a gem. The program comes with a hive function that allows you to scan the Windows directory of a system drive connected to a running computer. Unfortunately, there is no complete list of supported software.

store license keys

Conclusion

Backing up your license keys is fairly easy, but it takes some time and possibly more than one tool. Even if you are not planning to re-install your computer, it’s always a good idea to know your software licenses are safe. Better yet, create a backup of your entire system, so you don’t have to jump through the hoops of setting up Windows and finding those product keys. Here are a few alternatives to a Windows installation from scratch:

Gamers might want to know How To Recover Lost Video Game Keys.

Discussion

Do you know all your license keys and where do you keep them?

Personally, if I have an installation disc, I make sure the code is written on the disc itself or its case. If I just have installation files, I keep a text file with the license key in the same folder. And obviously those discs and files are backed up.

Image credits: Key Barcode via Shutterstock


Customizing WordPress Feeds

By Jeff Starr, Digging into WordPressOctober 23, 2012 at 02:41PM

WordPress feeds enable your visitors to subscribe to your content for use in their favorite feed-reader. For example, subscribing to the main-posts feed and/or the comments feed is a great way for your readers to stay current with all the latest from your site.

With WordPress, you can deliver a wide variety of “Full-text” or “Summary” (partial) feeds in numerous formats, including Atom, RDF, and RSS2. This variety extends the reach of your content by enabling your feeds to be read in more apps, readers, and devices.

As awesome as the default feeds may be, they are also readily customizable using a variety of methods. In addition to WP‘s built-in ways of configuring your feeds, you can go even further with custom templates, functions, and plugins. In this DigWP post, you’ll learn everything you need to customize your feeds with bonus content, recent posts, social media, and much more.

Contents

Overview of WordPress feeds

By default WordPress generates a feed for just about everything, as seen in this overview:

Feed type Description Example*
All Posts Main content feed – includes your latest posts https://digwp.com/feed/
All Comments Main comments feed – includes latest comments https://digwp.com/comments/feed/
Individual Posts Includes latest comments on a specific post https://digwp.com/2009/07/getting-more-fine-grained-with-includes/feed/
Individual Pages Includes latest comments on a specific page https://digwp.com/archives/feed/
Archives Day, month, year – includes latest posts in each archive https://digwp.com/2010/feed/, https://digwp.com/2010/10/feed/, https://digwp.com/2010/10/02/feed/
Search Results Includes latest posts for a particular search query https://digwp.com/search/term/feed/

* Note: examples show feed URLs when WP permalinks are enabled.

As if that many feeds weren’t enough, each type of feed is available is the following formats:

  • Atom – append /atom/ to any type of feed
  • RDF – append /rdf/ to any type of feed
  • RSS2 – append /feed/, /feed/rss/, or /feed/rss2/ to just about any WP-generated page (this is the default feed format)

For more details, here’s a complete guide to all of the different WordPress feed URLs.

Note: In previous versions of WordPress feeds were also generated in RSS-0.92 format, but those now are redirected to their respective RSS-2.0 formats, even though the template file for RSS-0.92 still exists in the core. The feed template files are what WordPress uses to generate the various types of feeds in their various formats. Let’s take a look..

Feed Template files

To generate the different feed formats — Atom, RDF, and RSS2 — for its myriad feed types, WordPress employs the following template files:

Post-based feeds

  • /wp-includes/feed-atom.php
  • /wp-includes/feed-rdf.php
  • /wp-includes/feed-rss.php
  • /wp-includes/feed-rss2.php

The post-based feeds look self-explanatory: feed-atom.php is used for Atom feeds, feed-rdf.php for RDF feeds, and so on. As mentioned, the thing to note here is that the feed-rss.php (for the RSS-0.92 format) still exists in the WP core, even though it’s no longer used, afaik.

Comment-based feeds

  • /wp-includes/feed-atom-comments.php
  • /wp-includes/feed-rss2-comments.php

The comment-based feeds are available in only two flavors: Atom and RSS 2.0. As with post feeds, requests for RSS-0.92 comment feeds are redirected to their respective RSS-2.0 formats. Also worth noting, requests for RDF-formatted comment feeds are mysteriously redirected to RSS2 post feeds. Examples:

For each of these examples, it would make more sense to redirect to the respective RSS2-formatted comments feed, rather than to any of the post feeds.

Feed functions

  • /wp-includes/feed.php

Lastly, the feed.php file contains some of the key functions used in the various feed-templates. For example, the rss_enclosure() function is used in feed-rss2.php to display any RSS enclosure(s) included for the current post. So, if you’ve added, say, the following enclosure to your latest post (via custom field named “enclosure”):

<enclosure url="https://awesome-video.flv" length="104857600" type="video/x-flv" />

WordPress will automatically insert the enclosure into your RSS2 feed via the rss_enclosure() function. Here is what your feed’s XML will look like after the enclosure is included (line breaks added for emphasis):

<item>
	<title>Awesome Video</title>
	<link>https://example.com/awesome-video/</link>
	<comments>https://example.com/awesome-video/#comments</comments>
	<pubDate>Wed, 17 Oct 2012 06:51:07 +0000</pubDate>
	<dc:creator>Perishable</dc:creator>
	<category><![CDATA[WordPress]]></category>
	<guid isPermaLink="false">https://example.com/?p=132</guid>
	<description><![CDATA[Check out this awesome video..]]></description>
	<wfw:commentRss>https://example.com/awesome-video/feed/</wfw:commentRss>
	<slash:comments>500</slash:comments>

	<enclosure url="https://awesome-video.flv" length="104857600" type="video/x-flv" />

</item>

And here’s what we see near the end of the feed-rss2.php template that makes it happen:

.
.
.
		<wfw:commentRss><?php echo esc_url( get_post_comments_feed_link(null, 'rss2') ); ?></wfw:commentRss>
		<slash:comments><?php echo get_comments_number(); ?></slash:comments>

<?php rss_enclosure(); ?>

	<?php do_action('rss2_item'); ?>
	</item>
	<?php endwhile; ?>
</channel>
</rss>

There is a similar function for including enclosures for Atom feeds, atom_enclosure, which is also included in feed.php. And so, now that we’re all up to speed on the what, why and where, let’s apply the information as we learn how to customize our own WordPress feeds.

Built-in ways to customize feeds

The easiest way to customize your feeds is by using the built-in options that WordPress provides. Probably these are familiar to most of us, but they’re worth mentioning along with some of their pros and cons:

Full-text or Summary feed?

If you visit “Settings” > “Reading Settings”, you can choose whether to syndicate your complete posts or only the excerpt. Note: does not apply to comment feeds, which always display comments in their entirety. Delivering partial-feeds is a good way to prevent content-scraping, while delivering full-feeds makes it easier for your readers to stay current (i.e., they don’t have to visit your site, which may be another reason to use partial feeds).

Number of posts/comments to include in feeds

To customize the number of items that appear in your post and comment feeds, visit “Settings” > “Reading Settings” and adjust the option, “Syndication feeds show the most recent”. The number that you choose will apply to both post and comment feeds.

Including larger numbers of posts can make your feed look more attractive to potential subscribers, which may be useful when delivering partial feeds. When delivering full-feeds, however, you may be better served by choosing a lower number of feed items. Here at DigWP.com, we deliver full-text feeds, eight at a time.

Character encoding for feeds

While the default UTF-8 character-encoding is recommended, it is possible to choose an alternate encoding method. Visit “Settings” > “Reading Settings” > “Encoding for pages and feeds” to make it happen.

Customize with custom templates

As explained in previous posts, a great way to generate custom feeds is to use a custom feed template. Those posts explain it all in detail, with the basic idea going something like this:

  1. Create a custom page template – and paste into it any existing feed template
  2. Modify the custom feed template – for example, change the number of posts, make it a category-specific feed, add custom XML enclosures, and so on.
  3. Provide a link to the feed – once everything is in place, the custom feed will be available at the URL of its custom page.

As you can imagine, using custom feed templates is an ideal approach, but it’s also possible to modify your existing feeds (instead of creating new ones). Read on to learn how..

Customizing with WP plugns

The easiest way to go further than default WP customization options is to use a plugin. There are many available. Here are some of our favorites that show the wide range of feed-customizing that’s possible with free WordPress plugins:

  • Comments On Feed – enables visitors to view and leave comments directly from each post in the WordPress content feed.
  • Feed Template Customize – enables you to modify WP’s RSS and Atom feeds using your own custom feed-templates.
  • RSS Image Feed – adds the first image of a post to your feeds, even in Firefox and even if you only display the excerpt.
  • RSS Custom Fields – includes all of your custom fields in your feed so you can pull data out of WordPress and use it elsewhere.
  • Custom Post Type RSS feeds – makes it “super easy” to create an RSS feed based on custom post types.

And there’s many more feed-tweaking plugins available in the WordPress Plugin Directory and elsewhere. Knock yourself out 🙂

Customizing feeds with filters and hooks

The most direct way of customizing WordPress feeds is to hook into them directly with actions and filters. For example, WP hooks make it easy to add custom content:

// add custom feed content
function add_feed_content($content) {
	if(is_feed()) {
		$content .= '<p>This article is copyright &copy; '.date('Y').'&nbsp;'.bloginfo('name').'</p>';
	}
	return $content;
}
add_filter('the_excerpt_rss', 'add_feed_content');
add_filter('the_content', 'add_feed_content');

With that snippet included in your theme’s functions.php file, WordPress will display a line of copyright information (for example) to each of your feed items. Of course, much more is possible once you’re able to target hooks for specific feeds. Fortunately, WordPress provides some useful format-specific feed hooks:

Atom post feeds

  • atom_ns()
  • atom_head()
  • atom_author()
  • atom_enclosure()
  • atom_entry()

RDF post feeds

  • rdf_ns()
  • rdf_header()
  • rdf_item()

RSS2 post feeds

  • rss2_ns()
  • rss2_head()
  • rss_enclosure()
  • rss2_item()

Atom comment feeds

  • atom_ns()
  • atom_comments_ns()
  • comments_atom_head()
  • comment_atom_entry()

RSS2 comment feeds

  • rss2_ns()
  • rss2_comments_ns()
  • commentsrss2_head()
  • commentrss2_item()

For more information (and more hooks), and to see where everything is located, check out the relatively short feed template files mentioned previously. Some of these hooks are also discussed in the WP Codex, and there are some additional infos elsewhere on the Internets. For now, we’ve seen how to hook into feeds and some feed-specific hooks to use, so let’s continue with some practical examples of customizing feeds via your theme’s functions.php.

Examples of customizing feeds via functions.php

Straight on then, here are some practical examples showing different ways to customize default WordPress feeds directly from your theme.

Add a custom logo and icon to your feed

As explained here, a useful way to boost your brand is to include a custom logo and icon to the header area of all of your feeds. Just add the following code to your theme’s functions.php file:

// add icon and logo to Atom feeds
add_action('atom_head','digwp_atom_feed_add_icon');
add_action('comments_atom_head','digwp_atom_feed_add_icon');
function digwp_atom_feed_add_icon() { ?>

	<feed>
		<icon><?php echo get_template_directory_uri(); ?>/images/logo.ico</icon>
		<logo><?php echo get_template_directory_uri(); ?>/images/logo.gif</logo>
	</feed>

<?php }

// add icon and logo to RSS feeds
add_action('rss_head','digwp_rss_feed_add_icon');
add_action('rss2_head','digwp_rss_feed_add_icon');
add_action('commentsrss2_head','digwp_rss_feed_add_icon');
function digwp_rss_feed_add_icon() { ?>

	<image>
		<url><?php echo get_template_directory_uri(); ?>/images/logo.gif</url>
		<title><?php bloginfo_rss('name'); ?></title>
		<link><?php bloginfo_rss('url'); ?></link>
		<width>125</width>
		<height>75</height>
		<description><?php bloginfo('description'); ?></description>
	</image>

<?php }

// add icon and logo to RDF feeds
add_action('rdf_header','digwp_rdf_feed_add_icon');
function digwp_rdf_feed_add_icon() { ?>

	<image rdf:about="<?php echo get_template_directory_uri(); ?>/images/logo.gif">
		<title><?php bloginfo_rss('name'); ?></title>
		<url><?php echo get_template_directory_uri(); ?>/images/logo.gif</url>
		<link><?php bloginfo_rss('url'); ?></link>
		<description><?php bloginfo('description'); ?></description>
	</image>

<?php }

Note that there are two images in play here: an icon for the Atom feeds and a logo for the Atom, RSS/RSS2, and RDF feeds. Once both the code and images are in place, your WordPress feeds will be uniformly branded with the ultra-buff image(s) of your choice.

Add feed <link> tags to your web pages

A great way to boost feed reach is to include automatic feed links to the <head> section of your web pages. When this theme-feature is enabled, WordPress draws upon its vast army of feed types and includes links to any relevant feeds for the current page view. This enables “feed-aware” devices and browsers to automatically detect your available feeds, making it easier for visitors to discover and subscribe. This theme feature is enabled with the following snippet added to your theme’s functions.php file:

// enable WP automatic feed links
if (function_exists('automatic_feed_links')) {
	automatic_feed_links();
} else {
	return;
}

Nothing else to do! Just slap it in there and enjoy your new automatic feed links. Huzzah!

Completely remove the version number from pages and feeds

By default, WordPress includes its version number in your feeds. If you’re always running the most current version of WordPress, there is nothing to worry about; otherwise, it’s a good idea to remove the version information wherever possible. Here’s the code to add to functions.php:

// remove version info from head and feeds
add_filter('the_generator', 'digwp_complete_version_removal');
function digwp_complete_version_removal() {
	return '';
}

As an added bonus, this technique also removes the version information from the <head> section of your web pages.

Delay feed update after posting

Thanks to the fine folks at WP Engineer, here is a technique for delaying feed-updates for a few minutes after posting a new post or page:

// delay feed update after posting
add_filter('posts_where', 'publish_later_on_feed');
function publish_later_on_feed($where) {
	global $wpdb;
	if (is_feed()) {
		// timestamp in WP-format
		$now = gmdate('Y-m-d H:i:s');

		// value for wait; + device
		$wait = '5'; // integer

		// https://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_timestampdiff
		$device = 'MINUTE'; // MINUTE, HOUR, DAY, WEEK, MONTH, YEAR

		// add SQL-sytax to default $where
		$where .= " AND TIMESTAMPDIFF($device, $wpdb->posts.post_date_gmt, '$now') > $wait ";
	}
	return $where;
}

After adding this code to your functions.php file, WordPress will wait five minutes before updating your feeds with the new content. This buys you some precious time to triple-check everything and fix any last-minute errors. To delay feed-updating for a longer (or shorter) amount of time, edit the $wait and $device variables to whatever you prefer.

Disable all feeds

With all this talk about customizing feeds, it’s worth asking whether or not you want to make feeds available in the first place. They’re enabled by default, but sometimes it’s optimal to disable them entirely or even selectively. Here’s the function to make it happen:

// disable all feeds
function digwp_disable_feed() {
	wp_die(__('<h1>Feed not available, please visit our <a href="'.get_bloginfo('url').'">Home Page</a>!</h1>'));
}
add_action('do_feed',      'digwp_disable_feed', 1);
add_action('do_feed_rdf',  'digwp_disable_feed', 1);
add_action('do_feed_rss',  'digwp_disable_feed', 1);
add_action('do_feed_rss2', 'digwp_disable_feed', 1);
add_action('do_feed_atom', 'digwp_disable_feed', 1);

Note: Only use this function if you want to disable your feeds! Or to only disable certain feeds, comment out or delete its corresponding add_action and you’re good to go.

Customize the only first post in feeds

For our last example, here is a way to target and customize only the first post in your various feeds. Add the following code to functions.php:

// customize first feed post only
add_filter('the_content', 'digwp_customize_first_feed_post');
add_filter('the_excerpt', 'digwp_customize_first_feed_post');
function digwp_customize_first_feed_post($content) {
	global $wp_query;
	if (is_feed()) {
		$feed_type = get_query_var('feed');
		if ($wp_query->current_post == 0) {
			return '<p>Put some custom content here!</p>' . $content;
		} else {
			return $content;
		}
	} else { return $content; }
}

This technique works out of the box to add some custom content (or whatever) to the first feed item, and is extendible to target subsequent posts as well. Feel free to customize the output to be anything that makes sense. Note: as-is, the custom content is added to the beginning of the first post. To add content instead to the end of the first post, switch the order of the first return, like so:

return $content . '<p>Put some custom content here!</p>';

Incidentally, I use this technique in my new feed-tracking plugin to add a custom-tracking image — works a treat!

Conclusion

We hope this article helps people in customizing their own WordPress feeds. The take-home message is that WordPress provides a wealth of possibilities when it comes to creating, formatting, and customizing your feeds. So be original, and have some fun 🙂


© 2012 Digging into WordPress | Permalink | 2 comments | Add to del.icio.us | Post tags: , ,