Forum
Setting a default category for new blog posts
I have a checklist of 3 categories that can be assigned to a blog post.
Is there a way to set or preselect a category when a new blog post is created?
(I had set 'required' to the checklist as a workaround, but if you go to the trouble of writing a long blog post and publish, the page refresh indicating that a category is required wipes out your text).
No, there's no way to automatically assign a default category.
Hello Winston,
If you know the category ID, you can use the
default
attribute on the categories tag to have it selected by default:Note this does not work with
display-as="checkboxes"
.Brilliant! That'll do nicely.
Does that work? Nice!
Yep, just tested - pre-populates the select menu with the specified category.