• Hi guys

    I have a default vanilla post category of relief-fund and tried creating a template file called single-post-relief-fund.php that I understood from the docs that the hierarchy should be used to display that category. I reproduced it below:

    The single post template file is used to render a single post. WordPress uses the following path:

    single-{post-type}-{slug}.php – (Since 4.4) First, WordPress looks for a template for the specific post. For example, if post type is product and the post slug is dmc-12, WordPress would look for single-product-dmc-12.php.
    single-{post-type}.php – If the post type is product, WordPress would look for single-product.php.
    single.php – WordPress then falls back to single.php.
    singular.php – Then it falls back to singular.php.
    index.php – Finally, as mentioned above, WordPress ultimately falls back to index.php.

    However, the template being used is single.php and it ignores the specific one. I have checked the db and post-type is definitely ‘post’. Am I missing something?

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • I think you have the single post template named incorrectly. The template filename should be single-relief-fund.php (note I removed the word ‘post’). Ensure you are using a child theme as changed to the parent theme may get overwritten the next time you update the parent theme.
    Barry

Viewing 1 replies (of 1 total)
  • The topic ‘Single post template not being used’ is closed to new replies.