[英]wordpress - Increase size of excerpt
我想在wordpress中增加摘錄的textarea大小,添加新的帖子頁。 我不想在文件中進行更改。
有什么方法可以增加摘錄文本區域的大小?
最簡單的方法是在以下位置添加一些CSS:
#excerpt {
height: 150px;
}
這將滿足您的想法。 您可以輕松地使用鈎子通過插件或主題將其注入僅管理員區域。 還有一些插件可以讓您添加自定義CSS。
此功能可讓您設置摘錄中的單詞數。 只需將其放在主題的functions.php文件中,然后將“ 20”替換為您要使用的數字或單詞即可。 將其放在文件末尾的?>
標記之前。
//custom excerpt length
function aw_custom_excerpt_length( $length ) {
return 20; // set the number to the amount of words you want to appear in the excerpt
}
add_filter( 'excerpt_length', 'aw_custom_excerpt_length');
在您的functions.php或任何插件文件中,粘貼以下代碼
function admin_excerpt()
{
echo "<style>";
echo "textarea#excerpt { height: 27em; }";
echo "</style>";
}
add_action('admin_head', 'admin_excerpt');
上面的代碼將增加摘錄的文本區域的行或高度。 因此,現在將顯示一個大盒子,而不是一小部分摘錄。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.