利用the_content
滤器这样,您可以调整/添加/删除内容中的某些内容
add_filter( \'the_content\', function ( $content )
{
// Make sure we only target the main query\'s content, adjust as needed
if ( !in_the_loop() )
return $content;
// We are targeting the correct content, so lets add what we need to
$new_content = \'<ol style = "padding:0;margin:0">\';
$new_content .= $content;
$new_content .= \'</ol>\';
return $content = $new_content;
});