您需要将代码放在子主题的php文件中,相对于您希望它出现的位置和页面。所以,如果你想让它出现在博客页面上,你可以把它放在你的单曲中。php文件位于内容调用(the\\u content())的正下方
或者,如果您将其放入函数中。php,您希望它在内容之后显示,您可以将其放入如下函数中:
function poll_after_the_content( $content ) {
    $custom_content = $content;
      if( current_user_can(\'editor\') || current_user_can(\'administrator\')) { 
         $custom_content .= \'<h2>I am an admin or editor!</h2>\';
        // stuff here for admins or editors
        }     
    return $custom_content;
    }
add_filter( \'the_content\', \'poll_after_the_content\' );
 此代码将添加“我是管理员或编辑!”以管理员或编辑身份登录时显示到所有帖子/页面。
更改此行:
         $custom_content .= \'<h2>I am an admin or editor!</h2>\';
 至
         $custom_content .= do_shortcode (\'[your_short_code]\');
 在内容后呼出您的投票。