',
'open_insert'=>'
',
'open_policy' => 'before',
'open_policy'=>'之前',
'close_tag' => 'h2',
'close_tag'=>'h2',
'close_insert' => '
',
'close_insert'=>' div>',
'close_policy' => 'before'
'close_policy'=>'之前'
)
)
);
);
// Do the usual Loop thing here...
//在这里做通常的Loop事情...
?>
?>
code> pre>
The About page (and only the About page) will have this inset section inserted.
“关于”页面(并且只有“关于”页面)将插入此插图部分。 p>
You can provide replacement rules that replace/insert at the first occurrence of a match, the next occurrence, all remaining occurrences, or all occurrences in the entire piece of content.
您可以提供替换规则,这些规则在匹配的第一个匹配项,下一个匹配项,所有剩余匹配项或整个内容中的所有匹配项处进行替换/插入。
You can place the inserted HTML before or after a match, or replace the match.
您可以将插入的HTML放在匹配之前或之后,或替换匹配。
Also, you can match a closing tag by simply providing the preceding slash character (eg. ‘/h2’).
另外,您只需提供前面的斜杠字符(例如“ / h2”)即可匹配结束标记。
Tag matches will match against any variant of a tag (upper or lowercase, with or without attributes, as an opening tag or as a self-closing tag like
).
标签匹配项将与标签的任何变体(大写或小写,带有或不带有属性,作为开始标签或作为自闭合标签,如
code>)匹配。In the rare case that something other than a tag needs to be matched, you can supply a raw regex instead of a tag.
在极少数情况下,除了标签以外还需要匹配其他内容时,您可以提供原始的正则表达式来代替标签。 p>
Providing instructions
提供说明 h4>
As the theme developer, you likely would want to let the content authors know that this magic insertion of sections will occur, and what landmarks need to be present in their content to trigger the sectioning.
作为主题开发人员,您可能希望让内容作者知道将出现这种神奇的部分插入,以及在其内容中需要出现哪些界标以触发该部分。 p>
In some file in your theme that gets loaded for every page (most likely functions.php
), you can provide such instructions along with the slug for the page to which the instructions apply.
在您的主题的某个文件中,该文件会为每个页面加载(很可能是 functions.php code>),您可以提供此类说明以及适用于该说明的页面的信息。The instructions will appear at the top of the Edit Page page in the admin.
说明将显示在管理员“编辑页面”页面的顶部。 p>
ContentSectioner::provide_instructions('about', " ContentSectioner :: provide_instructions('about',“ A blue background will be placed behind everything starting at the first Heading 3
从第一个标题3开始,蓝色背景将被放置在所有内容的后面
through just before the next Heading 2.");
直到下一个标题2。”);
code> pre>
Full User Guide
完整用户指南 h4>
For full documentation and more sample use cases, visit the Content Sectioner homepage.<
有关完整文档和更多示例用例,请访问 Content Sectioner主页。<
/p>
/ p>