Do you want to run a music or podcast site? Maybe you’ve already tried and have run into some problems. Or maybe you are just looking for some pointers to help your site out. I’ve run a series of posts on my personal site, Rev. Voodoo’s Blog, for nearly 5 years now. I have hundreds of DJ mixes over there and I’ve stumbled and reconfigured many times. This post won’t be a step by step tutorial, it might not even end up being very linear. I just figured I could brain dump a variety of things I have come across and maybe some of my learnings will be useful to you! Let’s dive in!
A while back, we had a pretty hand tutorial on how to work with the featured image functionality in WordPress. We covered a fair bit of useful info in that post. How to get going with the image, how to set sizes and use them, and how to display featured images. One thing we did was show, using a conditional, how to display a default image. Basically if an image isn’t set, display a selected image. A few people have asked how to actually set a default image as the featured image for a post if one isn’t set, rather than just display a default image. Here’s the trick:
OK people. my apology to any of you who actually waited for me to post this. there was a lot going on for me latley. trip to my country, holidays, work got crazy in the holidays, new year, camping trip for my birthday and the best part is my new iMac :). so now i can smothly write This second part of this tutorial. In the first part i showed you how to create “my-posts” page and how to delete a post. In this tutorial i will show you how to edit post from front end. There is a little more going on in this part so i will try to explain it the best way i can. note that this form works for custom taxonomies when it comes to categories and tags. so i am not sure how it will work with regular categories and tag but if there are problems we can all try to figure it out. and same as in the first part of the tutorial i will break it to sections.
Yesterday we looked at expanding our knowledge of meta boxes. We added in a variety of form elements to our front end post form. What about the backend? We’ll it’s not quite as easy, but the concept remains the same. The hard part really comes from the fact that I like my selections to appear if I edit a post. From a front end post form that isn’t a concern, since I don’t allow front end editing (yet). But on the backend, if I select a checkbox, or dropdown, then next time I visit that post to edit it, I would like to see my selections saved and displayed. Let’s play around with some meta boxes.
We’ve used meta boxes in a couple of different ways on our tutorials here. We’ve added them from functions.php to be used in the backend post screen, and we’ve added them to our front end posting form. Let’s expand on that idea a little, we’re going to take a look at how to use dropdowns, radio fields, and checkboxes with our meta boxes from the front and back ends.
Over the past three days we’ve accomplished quite a bit. First we set up a form to post from the front end. Once we had the form all set up, we dropped in some code to allow images to be uploaded with the form. And finally we added in the ability to use custom meta boxes on our form to collect additional information in custom fields for us to use. That’s a lot of code. Plus I had some difficulties with code that sometimes worked and sometimes did not. I got that all fixed. I thought it might be best to drop the full code I have in one post so that we can review it together.
So far this week, we have learned how to post from the front end. And we’ve expanded on that by allowing image uploads from the front end. We are going to go one step further today and add a meta box to our form. This way we can use the meta box to gather data and feed it into a custom field so we can use that data. The data can be just about anything, really use your imagination here. I’ll give some examples of stuff I’m thinking of, let’s get into it!
So far in this little mini-series, we have learned how to add in new post formats to our twenty ten child theme. We have set up meta boxes to enter in a URL for our Link post format. We have split out our formats to individual templates, and we set up our new link format in it’s own template, and made use of the URL to link the title of the link post format to the original article. But what if someone visits our site and comes directly to the single post view of the link post? Our edits so far have only affected the index/blog view (and archives). Well today we will get that link added in to the single post view. Check it out!
If you’ve been following along with this little series at all, you now that over the past several posts, we’ve looked at adding in custom meta boxes to be able to input a URL for our link post format. And we looked at how to split out our post formats to make it easier to edit existing ones, and add new ones. Today we will make use of the custom meta box, by actually taking that URL you can input to the meta box from your post screen and applying it to the title of your post, so that rather than the title linking to the articles permalink, it will link to the original article you are referencing.
So yesterday we briefly went over custom fields in this article. Today we are going to expand on that with some meta boxes. Meta boxes are really just a fancy way to input custom fields. They are less confusing for you and anyone else using your theme, as they can prompt for exactly what is needed. These can be text boxes, text areas, check boxes, etc. It’s up to you how you implement them. I only recently started using meta boxes, but I love them. Let’s take a look at how to use them.