Template for individual post designs

I browsed through the suggested posts, and couldn’t find anything that was exactly answering my question. I apologize in advance if I’m reposting something obvious here, but there you have it.

I want to make a theme that makes it easy to hand-craft my (single page) posts as if I was living without a CMS at all. I do still want these posts to have the benefits of being archived, perma-linked, getting stats, using the media library and so forth from WP, but I want the authoring flow to be as if I started with a blank folder with a “index.html”, a “style.css” and a “scripts.js” file every time.

It’s been a while since I was working with WP, but here’s a sort of a checklist of stuff I want.

  • The ability to “toggle” which parts of the loop are visible and which aren’t. (“toggle date, toggle post title, toggle footer, toggle footer elements, toggle comments link, etc”.)
  • The ability to specify in the WP authoring space a CSS file and a JS file specific to that post. I guess entering this into textareas would suffice as well.
  • Uploading images for backgrounds and other design-related images to a place that’s coupled to the post directly rather than just uploading them to a folder via FTP and using the direct links.

I’m not sure I’m communicating very well here, but imagine that my motivation is that when I create a post I want full control over how that post looks (again, in single post view) as if I’d designed it from scratch, but I want to take advantage of the handy mark-up that WP creates and the content management abilities of WP.

If you do understand what I’m getting at I’d love some pointers to where to start in form of links to themes that incorporate some or several of these features, advice on how to go about letting each post have a dedicated folder with belonging styles, scripts and images without making a godawful mess and so forth.

If you don’t understand what I’m talking about I’d really love for you to help me out by telling me where I’m being fuzzy so that I can clarify my ideas a bit.

Thanks in advance,
Martin

2 Answers
2

This shouldn’t be very difficult.

WPs Template Hierarchy should get you started on what page loads every time.

You’ll probably be best maintaining minimal header.php and footer.php and working your logic on single files, named as per the Hierarchy.

Then, head to add_meta_box() and update_post_meta() to implement those selectors for css and js and also any switches to toggle.

Then, it’s about the best use you can make of the Conditional Tags to dinamically find out which content you’re loading and fetch the right files for it.

Leave a Comment