wp-cli 로 wordpress 테마 관리하기
help
help theme 명령을 실행하면 theme 하위 명령어를 볼 수 있습니다.
$ wp-cli help theme NAME wp theme DESCRIPTION Manages themes, including installs, activations, and updates. SYNOPSIS wp theme <command> SUBCOMMANDS activate Activates a theme. auto-updates Manages theme auto-updates. delete Deletes one or more themes. disable Disables a theme on a WordPress multisite install. enable Enables a theme on a WordPress multisite install. ...
조회와 검색
status
theme status 명령으로 현재 테마의 목록과 활성화 여부를 알수 있습니다.
$ wp-cli theme status 3 installed themes: I twentynineteen 2.1 I twentytwenty 1.8 A twentytwentyone 1.4 Legend: I = Inactive, A = Active
A 는 활성화된 테마이며 I 는 비활성화된 테마입니다.
search
search 명령어로 테마를 검색할 수 있습니다. 다음은 sydney 란 단어가 있는 모든 테마를 검색하여 출력합니다.
themeforest 등에서 판매하는 상용 테마는 검색되지 않습니다.
$ wp-cli theme search sydney Success: Showing 2 of 2 themes. +--------------+--------------+--------+ | name | slug | rating | +--------------+--------------+--------+ | 시드니 | sydney | 98 | | Hotel Sydney | hotel-sydney | 0 | +--------------+--------------+--------+
관리
설치
install 명령 뒤에 설치할 테마 이름을 입력하면 됩니다.
$ wp-cli theme install astra
갱신
$ wp-cli theme update astra
활성화
activate 명령으로 활성화. 기존에 활성화한 테마는 자동으로 비활성화됩니다.
$ wp-cli theme activate astra