Create a specific wordpress template for an article

This support request was posted in Flatbase by powdesign

Request ID #30803 Resolved
  • I have the flatbase theme and have a lot of articles. These articles have categories assigned to them.
    I just cant figure out how to create a seperate wordpress template file that can be customised depending on which category that article belongs to.

    Your help would be much appreciated.

    Juanfra Aldasoro

    Hi,

    Thank you for writing. I hope you are doing well.

    Unfortunately this type of question would be considered as customization (actually extending the theme functionality via WordPress) and we cannot provide support for customizations. We wrote an article explaining this and you can find it here: https://nicethemes.com/article/support-vs-customizations-2/

    That being said, I wanted to mention that articles use a custom post type named article and the article categories a taxonomy named article-category.

    WordPress let you create custom templates for custom post types and custom taxonomies. You can read more about it here:

    Custom Post Type Templates
    Custom Taxonomy Templates

    Best,
    Juan.

    Hi Juan,

    Thanks for your reply, I totally understand. Its just that I can’t seem to find the answer anywhere. I just need a bit of code to add to the functions file and then need to potentially create
    single-article-categoryid.php but I cannot seem to get it to work. I think because the category is within the article part instead of the post maybe?

    Juanfra Aldasoro

    Hi,

    Thank you for the follow up.

    I see. I think that the best answer you can find is in the WordPress documentation as this is a WordPress template hierarchy issue. You can find the complete article here: https://developer.wordpress.org/themes/basics/template-hierarchy/

    Best,
    Juan.

    Hi Juan,

    Ok thank you.

    Kind Regards
    Faisal

    Juanfra Aldasoro

    Hi Faisal,

    No problem.

    Have a nice day,
    Juan.

Viewing 6 posts - 1 through 6 (of 6 total)

This topic is marked as resolved

Only the topic author can re-open this thread.

Login to your Account

Welcome back! Please log in to your account by filling the fields below:

Forgot?

Not a member? Create a free account.

Create a Free Account

You're 27 seconds away from some awesome WordPress free stuff, benefits and more. Create a free account and have access to our free products, benefits and more!

Already have an account? Log in
Secure Server