• Resolved buzzlyhan

    (@buzzlyhan)


    Hi,

    I would like to know how to create a custom single post HTML template for a specific category in a block theme.

    Could you help me with this?
    Has this question been asked before

Viewing 4 replies - 1 through 4 (of 4 total)
  • If you want to create a custom post single. Just copy the single.php file and paste it and change the name to single-yourposttypeslug.php. Now write the html part in the loop.

    Thread Starter buzzlyhan

    (@buzzlyhan)

    Hi, Supratim Chatterjee.

    Thank you for your reply.
    So, are you saying that an HTML template like ‘single-yourposttypeslug.html’ is not necessary?
    I was under the impression that FSE themes were built using HTML templates in the template folder.

    I was under the impression that FSE themes were built using HTML templates in the template folder.

    Yes, that’s correct.

    My understanding is that Block/FSE themes follow the same template hierarchy as Classic themes.

    Block themes currently support the classic PHP template files as a fallback if WordPress can not find the HTML file. But if the equivalent HTML template file exists in the theme’s templates folder, it’ll be used instead of the PHP file.

    Thread Starter buzzlyhan

    (@buzzlyhan)

    I understand that if something doesn’t work in an HTML template, it can be written in PHP.

    Thank you George Appiah!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to create a custom single post HTML template’ is closed to new replies.