WordPress: Adding “Get Shortlink” to Custom Post Types

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.

Fill Your WordPress Blog With Fake Content

I realize the concept may seem kind of silly to most people, but I recently needed to fill one of my WordPress sites with a bunch of fake content in order to do some testing. Rather than going through the tedious process of trying to create a bunch of fake posts and pages myself, constantly switching back and forth between lipsum.com and my test WordPress site, formatting the content in different ways; I headed to Google to see what I could find.