# 自定义 WP Discourse 模板的结构

**URL:** <https://meta.discourse.org/t/customize-the-structure-of-wp-discourse-templates/50754>\
**Category:** Administrators\
**Tags:** wordpress, how-to\
**Created:** [2016 年9 月 27 日 20:31 UTC](https://meta.discourse.org/t/customize-the-structure-of-wp-discourse-templates/50754 "2016-09-27T20:31:24Z")\
**Posts on this page:** 1\
**Showing post:** 39

<div class="post-metadata">

作者： ![Mikhail\_Tyuftyaev](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mikhail_tyuftyaev/32/237998_2.png) [@Mikhail\_Tyuftyaev](https://meta.discourse.org/u/Mikhail_Tyuftyaev)\
发布日期： [2021 年11 月 18 日 19:09 UTC](https://meta.discourse.org/t/customize-the-structure-of-wp-discourse-templates/50754/39 "2021-11-18T19:09:39Z")

</div>

大家好。请告诉我如何将论坛帖子的内容包装在  
`\u003cnoindex\u003e{content}\u003c/noindex\u003e`  
标签中。我尝试这样做。

```plaintext
function wpdc_custom_publish_format_html( $input, $post_id ) {
    ob_start();
    ?>
    <noindex>
    <small>
        <?php echo esc_html( self::Vget_text_options( 'published-at-text' ) ); ?>
        {blogurl}
    </small>
    <br>
    {excerpt}
    </noindex>
    <?php
    $output = ob_get_clean();
    return $output;
}
add_filter( 'discourse_publish_format_html', 'wpdc_custom_publish_format_html', 10, 2 );

```

这导致了一个严重错误。  
请帮助解决这个问题。

---

_[View the full topic](https://meta.discourse.org/t/customize-the-structure-of-wp-discourse-templates/50754)._
