你可以用the_content
过滤器:
/**
* Adds some text to bottom of the content on \'season\' pages.
*
* @param string $content The current content of the season page.
* @return string The new content of the season page.
*/
function add_season_content( $content ) {
if ( is_singular( \'season\' ) && is_main_query() ) {
// collect your season data over here...
$season_data = \'Hello world\';
$content .= $season_data;
}
return $content;
}
add_filter( \'the_content\', \'add_season_content\' );
将此代码放在插件文件中的任意位置。