WordPress.org

Ideas

Custom Template file for single

  1. Jam Viet
    Member

    12345

    i want to make some post cuter than it is, but WordPress doesn't support single-ID.php so if WordPress can add it to core in the near future ?

    It's can be easy for WordPress to add this support and make us more option to design template!

    Thanks !

    Posted: 1 year ago #
  2. gerald@WPcustoms
    Member

    12345

    I cannot see a situation where this is needed. If you want to style particular content you can use page-{ID}.php

    It makes more sense with single-{post_type}.php to give the whole cpt a specific design.

    I think a part of the concept of a CMS is consistent layouts for same content-types.

    on the other hand speaking of consistency: every other template does support -{ID}.php(tag, author etc) except single ?!

    Posted: 1 year ago #
  3. Jam Viet
    Member

    12345

    BUt it is so simple for wordpress to add ID to single theme, i have to design some of my single post to suit my case :D

    But thank for responing !

    Posted: 1 year ago #
  4. Mihail Semjonov
    Member

    There's a quick workaround on this.
    In your post in custom fields add a field ( for ex. ) template.
    Give it value..
    In your single.php before any code
    do something like chacking these meta and if it exists do checking if file exists in both child and parent theme.. if exists then load it.
    get_template_part('single', $meta ); exit;
    thats it.. simple workaround.

    I personaly think there's no need in single-{id}.php

    But perhaps making filter where's wp is teling wich file to load would be nice ( don't know if it exists or not already ).
    Then it would be easear to make these throught filter than editing single.php file like i was suggesting.

    Posted: 1 year ago #

RSS feed for this topic

Reply

You must log in to post.

  • Rating

    12345
    2 Votes
  • Status

    Sorry, not right now