內容目錄
內容簡介
Lexicon Entries 包括“詞語”和“定義”(如果您正在創建常見問題解答,這相當於“問題”和“答案”),可以以與標準 WordPress 文章完全相同的方式進行管理。
Lexicon Entries 也可以分類組織。
使用 shortcode 顯示 Lexicon Entries,您可以顯示所有條目或某些分類的條目。
詞語按字母順序索引,最初只顯示詞語-單擊任何詞語將展開條目以顯示定義。
使用 shortcode
最簡單的用法是使用沒有任何參數的 shortcode:
[lexicon]
這將顯示所有類別中的 Lexicon Entries 並使用默認樣式。
要顯示單個分類的 Lexicon Entries,請使用“category”參數指定類別別名:
[lexicon category="general-entries"]
要顯示多個類別的 Lexicon Entries,只需提供逗號分隔的類別別名列表:
[lexicon category="general-entries,specialist-subjects,misc-entries"]
您可以使用“before_heading”、“after_heading”、“before_title”和“after_title”參數更改 Lexicon Entries 的樣式。
“before_heading”和“after_heading”參數指定索引標題之前和之後使用的 HTML。默認情況下,“before_heading”設置為“”,“after_heading”設置為“”。
例如,如果您想以較大的大小顯示這些項目,可以使用以下內容:
[lexicon before_heading="<h1>" after_heading="</h1>"]
同樣,“before_title”和“after_title”參數指定實際的 Lexicon Term 之前和之後使用的 HTML。默認情況下,“before_title”設置為“”,“after_title”設置為“”。
例如,如果您想以較大的大小顯示這些項目,可以使用以下內容:
[lexicon before_title="<h1>" after_title="</h1>"]
外掛顯示在條目上方的默認說明為:“單擊下面任何詞語可顯示定義。”您可以通過指定“instructions”參數來更改這些說明。
[lexicon instructions="單擊下面任何一項顯示更多..."]
您可以通過指定“before_instructions”和“after_instructions”參數來更改說明的顯示方式。默認值為“before_instructions”是“”,“after_instructions”是“”。
例如,您可以指定以下內容,以使說明顯示在元素中:
[lexicon before_instructions="<div>" after_instructions="</div>"]
您可以指定“skin”參數,它將對 Lexicon Entries 應用一些標準樣式。此參數可以取以下值:“simple”(默認值)、“red”、“green”和“blue”。
例如,以下內容將以藍色顯示 Lexicon Entries:
[lexicon skin="blue"]
如果您想向 Lexicon Entries 添加自己的樣式,可以指定“class”參數以將自己的類添加到 Lexicon Entries 中。
外掛標籤
開發者團隊
原文外掛簡介
Lexicon Entries consist of a “Term” and a “Definition” (if you are creating FAQs, this equates to a “Question” and an “Answer”), and can be managed in exactly the same way as standard WordPress posts.
The Lexicon Entries can also be organised into Categories.
The Lexicon Entries are displayed using a shortcode, allowing you to display all entries or those for certain categories.
The terms are indexed alphabetically, and initially only the terms are displayed – clicking on any term will expand the entry to show the definition.
Using the shortcode
The simplest usage would be to use the shortcode with no parameters:
[lexicon]
This would show all Lexicon Entries in all Categories with the default styling.
To show the Lexicon Entries for a single category, you would specify the category slug using the category parameter:
[lexicon category="general-entries"]
To show Lexicon Entries for a number of categories, simply supply a comma-separated list of category slugs:
[lexicon category="general-entries,specialist-subjects,misc-entries"]
You can change the styling of the Lexicon Entries using the before_heading, after_heading, before_title and after_title parameters:
The before_heading and after_heading parameters specify the HTML used before and after the indexation heading. By default, before_heading is set to
and after_heading is set to
.
If you wanted to have these items displayed at a larger size you could use something like:
[lexicon before_heading="
" after_heading="
"]
Similarly, the before_title and after_title parameters specify the HTML used before and after the actual Lexicon Term. By default, before_title is set to
and after_title is set to
.
If you wanted to have these items displayed at a larger size you could use something like:
[lexicon before_title="
" after_title="
"]
The default instructions that are displayed above the entries by the plugin read: “Click on any term below to reveal the description.” … you can change these instructions by specifying the instructions parameter:
[lexicon instructions="Click on any item below to reveal more ..."]
You can change how the instructions are displayed by specifying the before_instructions and after_instructions parameters. The default value for before_instructions is
, and for after_instructions is
.
For example, you could specify that the instructions are displayed in a
[lexicon before_instructions="
"]
You can specify a skin parameter, which will apply some standard styling to the Lexicon entries. This parameter can take the following values: simple (the default value), red, greenand blue.
For example, the following would display the Lexicon entries in blue [lexicon skin="blue".
If you want to add your own styling to the Lexicon entries, you can specify the class parameter to add your own class to the Lexicon entries for styling with CSS. Specifying the class parameter will cause the skin parameter to be ignored.
For example, you could use:
[lexicon class="myclass"]
