For some reason, by default, WordPress only includes the “Get Shortlink” button when editing posts; not when editing any kind of custom post type or when editing pages. Honestly, I’m not sure why, since pages and custom post types all use the same basic short URL as standard posts (example.com/?p=[post_id]).
The solution is simple, though. You just need to hook into the get_shortlink filter. Following is a simple function that will help you add the button to all “publicly_queryable” post types in your theme.
If you use WordPress (especially as a content management system) and you haven’t heard of Mark Jaquith’s “Page Links To” plugin, you should definitely check it out. Basically, the plugin allows you to set up a WordPress page or post to redirect to a different URL. It can be very handy for setting up redirects, adding menu items for pages that wouldn’t normally appear in those menus, etc.
One issue with the plugin, however, is that it does not (as of version 2.4.1) support custom post types. It only supports WordPress posts and pages. If you want to set a custom post type to redirect to a URL other than its permalink, you can’t do so with this plugin.
However, there is a pretty simple way to add support for custom post types to this plugin; and the changes do not require you to edit the plugin itself. Instead, you can make all of the necessary changes in your theme’s functions.php file.
As we continue to transition whole-hog into HTML5 with new Web development, there are a few things you might need to know before deciding how to handle certain situations. I have discovered two somewhat major gotchas over the last few months that really made me reconsider my usage of the new technology.
While articles, asides, headers, footers, etc. are a fantastic way to introduce semantics into your page designs, there are a few elements and attributes that might not do quite what you’d expect.
I am not really a fanboy of any company (other than Sega), but I do appreciate when a company does something well. For Microsoft, there have been a few bright spots over the last few years (even if they haven’t all been commercially profitable). Among those, I’d include the Zune as the best portable media player (note, I didn’t say “handheld entertainment device”, as the Zune and the ZuneHD were basically designed to do one thing, and do it extremely well); the Xbox 360 as quite possibly the best modern gaming console (though I do love my Wii, the Kinect kind of tipped the playing field slightly in Microsoft’s favor – or so I’ve been told; I don’t own a 360, yet); and Windows Phone 7 has, as much as Android and Apple fanboys would hate to admit, somewhat revolutionized the mobile touch interface.
Do I expect to see whole-hog clones of the WP7 Metro UI, the way we did with iOS? Absolutely not; but I do suspect that we’ll see subtle changes to touch interfaces over the next year or so as a result of the way the Windows Phone OS works.
All of that said, I can’t help but wonder what the Xbox team was thinking when it came up with the pricing structure for Microsoft Points or when they integrated Netflix into the Xbox ecosystem.
Because Opera is not an extremely popular browser, most developers probably aren’t aware of one of its greatest features: Opera Show mode. Opera Show mode is the official name of the full screen mode for Opera (technically, it’s only called Opera Show when a projection media style sheet – discussed below – is present); and it brings with it a great possibility.
More than two years ago, Opera added support for the projection media mode in CSS. Whenever the browser is expanded to full screen mode, it activates the projection media, allowing you to apply a completely different stylesheet to the full screen page than you have in other settings.