我肯定这是个骗局,但我真的找不到答案。
我想在帖子的开头和结尾添加一条消息:
"Check out my new startup: Facebook For Dogs!"
有没有一种简单的方法可以做到这一点,希望使用插件?我肯定这是个骗局,但我真的找不到答案。
我想在帖子的开头和结尾添加一条消息:
"Check out my new startup: Facebook For Dogs!"
有没有一种简单的方法可以做到这一点,希望使用插件?你会想加入the_content
添加消息。
类似这样:
<?php
add_filter(\'the_content\', \'wpse51338_filter_content\');
/*
* Filter the content to add a message before and after it.
*/
function wpse51338_filter_content($content)
{
// not a singular post? just return the content
if(!is_singular())
return $content;
$msg = sprintf(
\'<p class="special-message">%s</p>\',
__(\'Here is an awesome message!\', \'your_textdomain_string\') // this is your message
);
return $msg . $content . $msg;
}
作为plugin.我遵循wordpress codex网站上关于通过插件创建管理主题的说明。我激活了插件,但我的样式表没有包含在<head>.. 这是我的代码:add_action( \'admin_init\', \'kd_plugin_admin_init\' ); add_action( \'admin_menu\', \'kd_plugin_admin_menu\' ); function kd_plugin_admin_init() { /* Register