QOTW: post templates

QOTW Penguin

This one isn’t a brain teaser, sorry. But I do still want your input!

How easy is it (is it even possible?) to set up templates for particular post types. For example, the Sunday Roasts and QOTWs have a particular format, including the same featured image and lots of blank href tags for links. It would be soooooo handy if there was a template I could use with the header and feature image, link tags etc already put in.

Help?

3 thoughts on “QOTW: post templates

  1. There are two ways to do this. A brutal hack and a more flexible solution. The brutal hack is easier:
    – Follow the first section here to create a new template(s): (http://www.wpbeginner.com/wp-themes/create-custom-single-post-templates-for-specific-posts-or-sections-in-wordpress/)
    Where the theme calls dynamically for the featured thumb and tags – i.e.
    if ( has_post_thumbnail() ) {
    the_post_thumbnail();
    }
    you then hardcode in the values you want over-writing the above call, again using an image as an example:

    The drawback to this is that is it totally inflexible. If you want to use a different thumb you will need to re-edit this template file and it will update every other post based on this template.

    – A more elegant solution would be to have the admin section of WordPress pre-populate the featured thumb, tags, etc and then create a list of custom fields or something for your urls which can then be inserted using shortcodes to your posts when you select the post template. This is something I’ve never done so can’t really offer up step-by-step advice on achieving it. The benefit this has is that the template still dynamically calls the post details for tags and thumbnail so you can amend or update them individually if you wished.

    So it is possible but not that simple to create an elegant solution, at least not as far as my WordPress knowledge goes.

    • OK, my brain shut down on about line 2 of your explanation. I know my technology and my coding, but I am SO out of the loop on how WP all hangs together. I might need my guru… Oh karmatosed, where are you?!

  2. Learning more about WordPress is on my list of major goals for this year. Unfortunately, I’ve been too busy to make much progress so far.

Leave a Reply