A) The<!--more-->
评论:
这里有一句话:
echo wp_trim_words( strip_shortcodes( strip_tags( get_the_content( \'\', true ) ) ), 50 );
我们使用的第二个参数
get_the_content()
将挑逗者隐藏在
<!--more-->
参与帖子内容。
B) The<!--noteaser-->
注释:
注意,存在
<!--noteaser-->
注释,我们可以使用它来控制帖子内容的摘要显示:
....
<!--more--><!--noteaser-->
...
在这种情况下,我们将使用:
echo wp_trim_words( strip_shortcodes( strip_tags( get_the_content( \'\', false ) ) ), 50 );
如果需要,我们还可以对上述输出应用其他过滤器。
在这种情况下,我们还可以使用:
echo wp_trim_excerpt();
然后用
excerpt_length
,
excerpt_more
,
the_content
, 和
wp_trim_excerpt
过滤器。
《星际迷航》Lorem Ipsum的一个例子:对于上述案例A:
Before:
Exceeding reaction chamber thermal limit.
We have begun power-supply calibration.
<!--more-->
Force fields have been established on all turbo lifts and crawlways.
Computer, run a level-two diagnostic on warp-drive systems.
Antimatter containment positive.
Warp drive within normal parameters.
I read an ion trail characteristic of a freighter escape pod.
The bomb had a molecular-decay detonator.
Detecting some unusual fluctuations in subspace frequencies.
Sensors indicate no shuttle or other ships in this sector.
According to coordinates, we have travelled 7,000 light years
and are located near the system J-25.
Tractor beam released, sir.
Force field maintaining our hull integrity.
After:
Force fields have been established on all turbo lifts and crawlways.
Computer, run a level-two diagnostic on warp-drive systems.
Antimatter containment positive.
Warp drive within normal parameters.
I read an ion trail characteristic of a freighter escape pod.
The bomb had a molecular-decay detonator.
Detecting some unusual fluctuations in subspace...