WordPress.org

Ideas

New Template File: single-ID.php

  1. David Yeiser
    Inactive

    We have the ability to easily create custom templates for specific categories and pages using category-ID.php and pagename.php, respectively.

    However, what if we want to create unique layouts for individual posts? The only option is to have multiple is_single(); conditionals in single.php. This is not ideal if we have any more than a few unique layouts.

    Why? Having unique layouts for different posts is a great way to liven up your blog and break the standard mold a bit, it's also a way to highlight important posts, tutorials, etc and gives the potential for other creative uses.

    Why not just make a page? Mainly because it wouldn't show up in the RSS feed. You would have to write a post linking to the page you created, which isn't the most optimal solution.

    NOTE: This is not requesting unique layouts for posts based on categories, but unique layouts for INDIVIDUAL posts.

    Thanks!

    Posted: 11 years ago #
  2. Ricky Irvine
    Member

    Is this in response to Jason Santa Maria's new site? Art/design directing on an individual article level is a great idea, especially since the the only thing that distinguishes one post from another is, generally, its text or images.

    Although I like this idea, and I'd like to see it, a downside to the post-id templates is that it will generally be only for the blogger who knows their way around ftp, html, php, css, and wp tags.

    What if, in addition to your idea, there were a template picker, like we have on pages? Something like what AIGA's CMS has: http://weightshift.com/work/aiga_cms/AIGA_CMS_Springboard.png

    Theme designers/developers could design a handful of post templates to choose from, and the author could choose whichever best fits.

    That would be cool.

    Posted: 11 years ago #
  3. David Yeiser
    Inactive

    Re: Jason Santa Maria, yeah, that has a lot to do with it. And just wanting a cleaner way of highlighting "big" posts with different designs.

    It would definitely be more for the advanced user. Adding the template picker for the posts (like pages) would be a great idea as well. I would assume that they both could be added with the same amount of difficulty as it would take to add them singularly.

    It would really open themes to be less "cookie-cutter" driven.

    Posted: 11 years ago #
  4. Ricky Irvine
    Member

    Are there ways around this? Such as filling the markup with class hooks so that you could write custom CSS based on the post id? It's a ZenGarden approach, I suppose.

    The template picker idea would be a ton of work, I know. And of course would create that much more work when creating themes.

    Your idea is a simpler approach, and seems like it could be made into a plugin pretty easily (although, I speak without any plugin-making experience).

    So, as far as it becoming a reality, what's the next step? Someone build a plugin? I'm not convinced this would become a main feature any time soon.

    Posted: 11 years ago #
  5. Alex Dunae
    Inactive

    On a single page, the post ID is available before the loop. In your header PHP, use $post->ID and customize away.

    Posted: 9 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.

  • Rating

    12345
    0 Votes
  • Status

    Duplicate of another idea