I’d like to add a new area on a WordPress 3.0 site that contains a new video from YouTube each day. This video would be manually picked, and manually added each day. I’m not sure how to properly set this up though.
My current thought-process is that I would create a category called “videos,” and then add a new post in that category each day placing the embed code as the post-body. This seems like ugly hackery though, so I’m open to a better and more leaner solution. Ideally I would have a simple admin-side form where I would put in a title, and the link to the YouTube video (converting the link to an embed code on my own programmatically).
Does WordPress 3.0 accomodate odd post types like this pretty well? What should I read to gain a better understanding of how I would accomplish things like “video of the day”, and “daily cartoons”?
I’d recommend using a custom post type to handle this. You can add the custom post type and set it to only accept the YouTube url as content. Then you can display the “most recent” post from this setup with a custom loop on your home page.
Here are a couple other good resources to start with:
Hi @Jonathan Sampson:
@EAMann is spot-on, Custom Post Types are the way to go.
Here’s code you can toss in your theme’s
functions.php
file to implement the Custom Post Type you need (note I included a helper functionmake_post_type_labels()
I like to use that reduces the complexity of defining Custom Post Types):Also you might find these two answers to be helpful as well: