我以前有一个工作正常的代码:
<div class="kabaut"><?php echo get_the_author_meta(\'description\'); ?></div>
最新更新后,wordpress现在添加<p> </p>
输出的标记。如何去掉这些标签?我以前有一个工作正常的代码:
<div class="kabaut"><?php echo get_the_author_meta(\'description\'); ?></div>
最新更新后,wordpress现在添加<p> </p>
输出的标记。如何去掉这些标签?get_the_author_meta
applies a filter get_the_author_{$field}
, i、 e.在你的情况下get_the_author_description
:
function stripp($value) {
return str_replace(array(\'<p>\',\'</p>\'), \'\', $value);
}
add_filter(\'get_the_author_description\', \'stripp\');
如果p
标记具有属性,您可能需要相应地修改以上内容,或使用preg_replace
.我有200篇博客文章链接到不同的用户。现在我把它们移到了新的Pods自定义字段“author”,因为我不想让其他用户访问我的博客。问题是我必须将每篇文章链接到不同的“作者”自定义字段。是否可以在批量模式下执行此操作,或者我必须编辑每一篇文章?