不用外掛也能增強你的WordPress編輯器

平常用一用WordPress內建的TinyMCE(所見即得編輯器),我認為它還不錯用(雖然有時候會覺得少了一些功能~~~但不錯用),而WordPress的外掛中有超多超多都是在增強內建的編輯器~~~不過啊~~用越多外掛,也就越容易耗資源,占空間,我就拿我自己的經歷來說好啦~~有一次我就下載一個類似功能的外掛,厲害的是它會把內建的編輯器變的超像WORD的~~但我又不是在辦公室,而且編輯文章的時候也變得非常非常慢,所以我寧願用內建的編輯器也不要用外掛,還好,我這次就是要提供如何加幾句語法,就能稍微有點陽春的內建編輯器,增加字體、分隔線、字號選擇、上標下標等功能~以下提供原本編輯器的功能圖~~~

接下來就是要教你怎麼用啦~~~~

將下列的代碼全部複製貼到你的主題post.php中

[cc lang=’php’ ]

function enable_more_buttons( $buttons ) {
$buttons [] = ‘hr’;
$buttons [] = ‘del’;
$buttons [] = ‘sub’;
$buttons [] = ‘sup’;
$buttons [] = ‘fontselect’;
$buttons [] = ‘fontsizeselect’;
$buttons [] = ‘cleanup’;
$buttons [] = ‘styleselect’;
$buttons [] = ‘wp_page’;
$buttons [] = ‘anchor’;
$buttons [] = ‘backcolor’;
return $buttons ;
}
add_filter( “mce_buttons_3” , “enable_more_buttons” );

[/cc]

貼完之後,按下[儲存](這不是在說廢話嗎????)

你就會發現你原本陽春的編輯器,搖身一變,變成了下面這模樣囉~

上面我所提供的代碼是在編輯器中,在新增一行來放下這些功能,

依照個人喜好,也可以將最後代碼改成

[cc lang=’php’ ]

add_filter( “mce_buttons_1” ,  “enable_more_buttons” );

[/cc]

這樣的話這些多出來的功能將會在編輯器的第一行顯示喔~~

以此類推~如果要跟第二行並列的話,則可以將最後一行代碼改成

[cc lang=’php’ ]

add_filter( “mce_buttons_2” ,  “enable_more_buttons” );

[/cc]

其實看完上面的代碼,你可能會發現有一些雷同的地方,

你添加更多功能的時候只要把代碼中“$buttons[] =” 後面單引號內的單詞換成

下面括號裡列出的那些英文單字就可以了啦!

1.剪切(cut)複製(copy)粘貼(paste)撤銷(undo)重做(redo)

居中(justifycenter)

2.加粗(bold)斜體(italic)左對齊(justifyleft)右對齊(justfyright)

3.兩端對齊(justfyfull)插入超鏈接(link)取消超鏈接(unlink)插入圖片(image)

4.清除格式(removeformat)下劃線(underline)刪除線(strikethrough)

5.錨文本(anchor)新建文本(newdocument)

6.字體顏色(forecolor)字體背景色(backcolor)

7.格式選擇(formmatselect)字體選擇(fontselect)字號選擇(fontsizeselect)

8.樣式選擇(styleselect)無序列表(bullist)編號列表(numlist)

9.減少縮進(outdent)縮進(indent)幫助(wp_help)

10打開HTML代碼編輯器(code)水平線(hr)清除冗餘代碼(cleanup)

11.上標(sub)下標(sup)特殊符號(charmap)插入more標籤(wp_more)

12.插入分頁標籤(wp_page)

13.隱藏按鈕顯示開關(wp_adv)

14.隱藏按鈕區起始部分(wp_adv_start)

15.隱藏按鈕區結束部分(wp_adv_end)

16.拼寫檢查(spellchecker)

 

預設圖片
Kirin Chang

喜歡幫助別人,
希望能讓世界上所有人都能悠游在
「資訊的雲端」中

文章: 123

31 則留言

  1. The trope of the overprotective hero is executed perfectly in this novel. Alex monitors Ava’s safety with an intensity that borders on obsession, but it comes from a place of deep care. Fans of the genre often look for the Twisted Love PDF to re-read their favorite scenes. The narrative arc is satisfying, taking the characters from a place of isolation to one of connection. It is a gritty, modern fairy tale where the prince is a villain to everyone but the princess.

  2. If you are looking for a book that balances spice and plot perfectly, this is it. The steam serves the story, not the other way around. The Twisted Love PDF is a popular download for this reason. The relationship progresses naturally from physical to emotional. It is a well-crafted novel that respects the reader’s time and intelligence. https://twistedlovepdf.site/ Twisted Love English Epub

  3. For a final recommendation, just read it. The hype is real. Twisted Love is a phenomenon for a reason. Get the Twisted Love PDF, get the paperback, get the audiobook – just get the story. Alex and Ava are waiting to break your heart and put it back together again. It is a journey you won’t regret taking. https://twistedlovepdf.site/ Twisted Love Ana Huang Free Pdf Download

  4. There is something incredibly compelling about the “brother’s best friend” trope when it is handled with the complexity that Ana Huang brings to the table. In this novel, Alex is not just a forbidden crush; he is a man with a dark agenda that inadvertently involves Ava. Readers often look for the Twisted Love PDF to access this gripping tale of betrayal and redemption instantly. The narrative pace is perfect, balancing the slow-burn romance with fast-paced thriller elements that emerge as Alex’s past catches up with him. It is a book that demands your full attention, rewarding you with a love story that is as tumultuous as it is beautiful. https://twistedlovepdf.site/ Twisted Love En Español Pdf

  5. Sometimes you need a book that will completely consume you, and the story of Alex and Ava does just that. It is a sweeping romance that travels from university campuses to high-rise boardrooms. Finding a Twisted Love PDF is a great way to take this journey with you anywhere. The author weaves a tale that is sexy, suspenseful, and surprisingly sweet in places. It challenges the characters to grow up and face their demons, making their eventual union feel like a hard-fought victory. https://twistedlovepdf.site/ Twisted Love Pdf Ana

  6. Женский онлайн-журнал https://rosetti.com.ua о стиле, здоровье и семье. Новости моды, советы экспертов, тренды красоты и секреты счастья. Всё, что важно и интересно женщинам любого возраста.

  7. Строительный сайт https://okna-k.com.ua для профессионалов и новичков. Новости отрасли, обзоры материалов, технологии строительства и ремонта, советы мастеров и пошаговые инструкции для качественного результата.

  8. Портал о дизайне https://sculptureproject.org.ua интерьеров и пространства. Идеи, тренды, проекты и вдохновение для дома, офиса и общественных мест. Советы дизайнеров и примеры стильных решений каждый день.

  9. I’m extremely inspired along with your writing skills as neatly
    as with the layout in your blog. Is that this a paid subject matter or
    did you customize it your self? Either way keep up the nice quality writing,
    it is rare to peer a nice blog like this one today. Beehiiv!

  10. 想請問一下,因為是初學者,在wordpress控制台內,找不到主題編輯器(在外觀的選項找不到> <),不知道是不是可以解決呢?謝謝你!

      • 嗨嗨!很謝謝你的解答,我有試著登入你提供的網址,但依舊是沒看到主題編輯器,是有需要付費升級才能有這選項嗎?真不好意思,因為是初學者爬文也爬很久了,還是一頭霧水 > < (截圖是要怎麼給妳參考呢?)

        • 你可以透過email傳後台截圖給我,還有WordPress.org都是不用付費的喔 如果你是使用WordPress.com網誌才有可能有收費的選項

          PS 信箱:esofthard【at】gmail.com
          【at】請改成@

    • WordPress資料夾/wp-content/themes/(你主題名稱/ 裡面就有喔

      或者你也可以在控制後台佈景主題的主題編輯器編輯你所用的佈景主題之post.php即可

      有問題歡迎繼續詢問,感謝

  11. […] 使用過多的外掛可能導致網站的處理速度變慢,此時可考慮採用此方法強化文字編輯器之功能,詳細作法可參考一、二。 […]

  12. 哈哈!! 感謝!! 成功嚕!!
    一開始我把那些代碼全加進WP_ADMIN裡的POST.PHP
    結果失敗…
    後來才發現要去貼在WP_INCLUDES裡的POST.PHP裡
    就成功嚕~~ :D

  13. 經過測試,目前 wordpress 3.5.1 的版本已經不ˋ能去改 functions.php 了,會出現錯誤訊息!

    現在最新的版本要把這些語法加到 post.php 中喔!

發佈留言