0

I'm currently working on another WordPress theme, supporting post formats. Adding post formats support to theme is easy, obviously — just few lines of code in functions.php. However from user's perspective it doesn't change anything. They still have the same form to fill. So I wonder how to replace the entire adding post form to something more relevant. For example: quote — it needs basically two fields: quote text and quote source... Link: it needs URL field, and maybe description, maybe title.

Take a look how Tumblr does it. It first asks you for post format and then displays appropriate form.

I'd love to avoid using external plugins and have it working out-of-the-box because I don't want to make my Clients install plugins to use theme I gave them.

Any ideas?

0

If you are developing your own theme (as you have indicated in your question), depending on the level of coding you want to get into, you are probably better off using one. Having said that it is certainly possible to do so without them, but this is what you're going to have to look at:

  1. custom fields for the data to be displayed. In your quote example, I would just use the standard content field to store the actual quote, but then create an author or source custom field to hold that information (personally I'm going to store the source in the post title).

  2. In your theme's functions.php file you will include the relevant hooks create a source text field for user input in the post creation admin area

  3. In your theme's single.php or style.css you would include the relevant mark-up and styling to present your extra field.

The last two would be very easily implemented utilising various plugins and one such plugin would be "Advanced Custom Fields" (I have no affiliation other than I use this plugin myself). Their website includes many examples on how to do just this (their home page includes all the info for adding a hero image to a post).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.