內容簡介
範本部件是儲存在您主題目錄中的可重複使用的程式碼片段。通常,它們被其他範本檔案使用 get_template_part() 函式來呼叫。此外掛會建立一個捷徑,以便您可以在文章內容中呼叫範本部件。
捷徑的使用方式為:[template part=”somepart”]。
範本部件必須存放在主題目錄中的「parts」資料夾內。
如果您在範本部件中使用自訂迴圈,請記得在結尾處使用「reset_query」函式以將頁面恢復正常。
外掛標籤
開發者團隊
📦 歷史版本下載
原文外掛簡介
Template parts are reusable snippets of code stored in your theme directory. Normally, they are called by other template files using the get_template_part() function. This plugin creates a shortcode for calling template parts from the body of a post.
Shortcode usage is: [template part=”somepart”].
Template parts must be stored in a “parts” folder within your theme directory.
If you use custom loops in your template parts, remember to use “reset_query” at the end to return the page to normal.
