Hack: Redirect Posts To Any URL

Suppose you have an old post that you want to remove, but you know there are still links to it out there. Ideally you want to redirect anyone coming to that page to another page on your site, or maybe even to another site. You can do that with a few lines of code, and in such a way that you can customize the destination URL on a post-by-post basis without touching the code again. So no need for a plugin or messing with your .htaccess file.

Continue reading “Hack: Redirect Posts To Any URL”

Hack: Display Category Descriptions On Archive Pages

So when someone ends up at an archive page on your site, like /category/something, they get a page title followed by a list of posts. That’s fine for a lot of purposes. But what if you wanted to put some text at the top of that? Maybe something that describes the category, explaining what sort of posts the reader is now viewing.

Continue reading “Hack: Display Category Descriptions On Archive Pages”

Hack: Password Protected Post With Custom Text

After yesterday’s post, I got to thinking that it would be useful to be able to customize the password protection text on a per-post basis. So not every password-protected post has the same exact same “This content is password protected…” replacement. Sp here is an alternative to that code that also looks for the custom field password_text. If found, then it will replace the standard text with whatever you put in that custom field.

Continue reading “Hack: Password Protected Post With Custom Text”

Hack: Change The Password Protected Text

When you password-protect a post, you get a standard message of “This content is password protected. To view it please enter your password below:” that is difficult to change. But what if you want to do some simple members-only posts every once in a while and send out the password for special posts every week in your newsletter. It could be a nice way to encourage people to sign up for your emails without needing to install a whole membership plugin. You could even use fun words that relate to your topic as passwords.

Continue reading “Hack: Change The Password Protected Text”