看看你的具体例子。。。您可能想使用短代码。类似于:
add_shortcode(\'hide_from_summary\',\'wpse_hide_stuff_here\');
function wpse_hide_stuff_here($atts,$content){
global $post; // gives access to the post, so you can determine mode
// don\'t know if you\'ll want/need $atts, so ... generic stuff here
$atts = shortcode_atts( array(
\'foo\' => \'no foo\'
), $atts, \'bartag\' );
// default output of this shortcode is blank (hidden)
$out = \'\';
//Only show your content if ... you are viewing the post by itself
if (is_a($post, \'WP_Post\') && is_single($post)) $out = $content;
return $out;
}
可以将此短代码添加到函数中。php或插件。然后,按以下方式应用它。
[hide_from_summary]
<p>THIS TEXT ONLY SHOWS IN SINGLE POST MODE SOMEHOW</p>
[/hide_from_summary]