自由切換 WordPress CLI theme

在 ijliao 那邊 看到 “CLI” 這個 WordPress theme,第一個感覺也是有個衝動想馬上換上去。

WP-CLI-Snap_P

這個模仿 Command line interface所製作的主題還有很多要改善的地方,例如我會很自然地按「上下鍵」想要叫出之前所下過的指令,按「Tab」鍵想要 auto-completed,還會打 「logout」…..

– priv 說,在 DreamHost 上因為關掉了 URL access ,所以沒辦法顯示那畫龍點睛的綠色灰階圖。沒關係,DreamHost 有提供 curl,用這個 patch 可以達到同樣的效果:

patch interpret.php cli_theme_on_dreamhost.diff

至於要如何在GUI及CLI之間切換,作者的作法

To get two themes with the same blog, I did this:

* Copy the blog directory, i.e. cp -R rod rodcli
* Edit rodcli/wp-settings.php like so:

//define(‘TEMPLATEPATH’, get_template_directory());
define(‘TEMPLATEPATH’, ‘wp-content/themes/cli’);

Note that this isn’t perfect: your /rodcli/wp-admin/ won’t work. Luckily, you still have the original blog for making posts with. With some cleverness, one could probably use symlinks to minimize the amount of code duplication.

這太麻煩了,我又不想要裝 ThemeSwitcher,所以乾脆寫了個plugin,攔截所有連到 [site_url]/cli的人,切換到 CLI mode。

舉例來說,這是 GUI 模式這是 CLI模式,多美好啊!!

這個plugin 可以在 這裡下載,解開後放到 WordPress 的plugin 目錄下啟動即可。

在〈自由切換 WordPress CLI theme〉中有 10 則留言

  1. 自動引用通知: =.= 街喵人生
  2. 自動引用通知: 超酷的 Wordpress theme - CLI - 安裝成功 at Dennys’ blog
  3. 自動引用通知: 終極邊疆BLOG » 自由切換 WordPress CLI theme
  4. hi,
    i am hunting for ro d s cli theme, but can t find it anywhere, do you have an archive you can mail me by any chance? would be great
    thx for your time!

    回覆

發表迴響

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料