如何在帖子标题后插入自定义消息。例如
The Post Title
My custom message
如何在帖子标题后插入自定义消息。例如
The Post Title
My custom message
您需要使用\'the_content\' 滤器
function add_before_content($content) {
return \'Before content area \'.$content;
}
add_filter(\'the_content\', add_before_content);
它仍将位于content div内。如果您希望它位于div外,则必须编辑相关模板文件,即single。php或模板/内容单一。php。这完全取决于要应用它的页面。我想您需要一个额外的输入字段。
你可以使用插件,比如“更多字段”。使用该插件,您可以创建更多字段(如名称所示)。
您可以创建一个文本区域,并在模板中的\\u标题和\\u内容之间放置一段代码。
您可以使用以下代码:
<?php meta(\'custom-field-name\'); ?>
祝你好运!嗨,我用这个代码从某个类别呼叫post<?php $queryObject = new Wp_Query( array( \'posts_per_page\' => 3, \'post_type\' => array(\'post\'), \'category_name\' => \'photos-bet-awards-2013-2\', \'orderby\' =&g