How do I set and list page_template with wpcli?
I have a page that has a new template, and I want to set that new template with wp-cli.
When I wp post get id
I get an output like the following:
+-----------------------+---------------------+
| Field | Value |
+-----------------------+---------------------+
| ID | 4 |
| post_author | 5 |
| post_date | 2012-03-09 13:11:38 |
| post_date_gmt | 0000-00-00 00:00:00 |
| post_content | |
| post_title | Home Page |
| post_excerpt | |
| post_status | publish |
| comment_status | closed |
| ping_status | open |
| post_password | |
| post_name | home |
| to_ping | |
| pinged | |
| post_modified | 2015-06-04 12:23:41 |
| post_modified_gmt | 2015-06-04 19:23:41 |
| post_content_filtered | |
| post_parent | 0 |
| guid | /?page_id=4 |
| menu_order | 0 |
| post_type | page |
| post_mime_type | |
| comment_count | 0 |
+-----------------------+---------------------+
This doesn't have the attribute I am looking for page_template
When I try what seems to be the correct attribute key:
wp post update 4 --page_template='New Home Page'
I get Warning: The page template is invalid.
Topic wp-cli page-template command-line pages Wordpress
Category Web