最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

functions - Remove <figure> tag on my RSS Feed

programmeradmin1浏览0评论

I need to remove the tag that appears on my feed content ($content variable).

/

Is there an existing function to this task?

Some tags appear with width instructions that are differents on each appear. How can I remove them completely?

I need to remove the tag that appears on my feed content ($content variable).

http://mkt-d.hospedagemdesites.ws/wp/feed/

Is there an existing function to this task?

Some tags appear with width instructions that are differents on each appear. How can I remove them completely?

Share Improve this question edited Jun 6, 2019 at 18:41 vts asked Jun 6, 2019 at 17:58 vtsvts 134 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 3

I believe the most direct way of customizing WordPress feeds is to hook into them directly with the following filter. Edit: as we talked about, let's just edit the content to tear out any

function edit_your_feed_content($content) {
    $content = preg_replace("/(<figure.*?[^>]*>)(.*?)(<\/figure>)/i", "", $content);
    return $content;
}
add_filter('the_content', 'edit_your_feed_content');
发布评论

评论列表(0)

  1. 暂无评论