您需要使用do\\u shortcode()使该短代码在PHP中实际工作
function add_post_content($content) {
if(!is_feed() && !is_home()) {
$above = \'<p></p>\';
$content_of_first_tab = \'A list of related posts \';
$args= array(
\'number\' => \'5\',
\'post_id\' => get_the_ID(), // use post_id, not post_ID.
);
$comments = get_comments( $args );
$output = \'\';
foreach ( $comments as $comment ) :
$output .= $comment->comment_author . \'<br />\' . $comment->comment_content. \'<br />\';
endforeach;
$content_of_second_tab = $output ;
$below = do_shortcode( \'[tabby title="First Tab"]\' . $content_of_first_tab . \'[tabby title="Second Tab"]\'. $content_of_second_tab. \'[tabbyending]\' );
$content = $above.\'\'.$content .\'\'.$below;
}
return $content;
}
add_filter(\'the_content\', \'add_post_content\');
此问题特定于插件,应发布在相应的
support forum执行
not 除非您知道自己在做什么,否则请复制并粘贴代码<我希望这对你有帮助。