0

I've recently started using wp-cli to work on WordPress and starting to love it.

However, I'm curious about creating page templates using wp-cli. I haven't been able to find anything on it, does anyone if I can create a page template using wp-cli.

I found the scaffold command but that also doesn't have the option to create it.

Wouldn't it be nice, if wp-cli has that option too?

If it already does, then do please enlighten me.

1

wp-cli is not a development tool, it is a server admin tool, as such all the scaffold stuff there is.... for lack of better word, unneeded bloat. It is unlikely to reflect best practice, especially if your copy is old.

In the specific case of page templates, there is really nothing worth "scaffolding" the easiest way to create a new page template is to locate one in a theme, copy to a different file name, remove the code (or not, depending how drastic the new template will differ) and edit the template name in the header. Using wp-cli for this will probably take more time.

  • thanks for your answer, but I don't see wp-cli as totally server admin tools. Agreed that most of the commands are related to server administration of wordpress's core aspects. but at the same time, there are many commands which are relevant for wordpress's features. – Dilip Gupta Jan 16 '17 at 6:57
0

I agree with @MarkKaplun, but the scaffolding part is what may be improved in the future. For instance, I like the scaffolding of plugins, and I will test today scaffolding of Unit tests.

I think this scaffolding tool has the future.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.