Oxwall-删除元标记

时间:2020-06-28 12:11:21

标签: html meta oxwall

如何在Oxwall软件或任何软件中删除元标记。 Oxwall核心会在自动错误的Facebook元标记上加载。

错误值(由Oxwall生成):

<meta name="og:type" content="website" />

正确值:

<meta property="og:type" content="website" />

预先感谢

2 个答案:

答案 0 :(得分:0)

您可以在基本文件或插件init.php文件中包含以下行。如果您不使用插件,请打开/ow_system_plugins/base/init.php并添加以下代码:

function modify_custom_meta_property(){
    OW::getDocument()->addMetaInfo('og:type', 'website', 'property');
}
OW::getEventManager()->bind(OW_EventManager::ON_BEFORE_DOCUMENT_RENDER, 'modify_custom_meta_property');

答案 1 :(得分:0)

最后我找到了解决方法。

您必须这样做:

  1. 转到ow_system_plugins / base / classes / event_handler.php,然后在文件末尾删除或注释掉添加错误的Facebook meta的所有行:

示例:

// $document->addMetaInfo("og:type", "website");

  1. 转到/ow_system_plugins/base/init.php,然后在文件顶部添加如下代码:

    function Modify_custom_meta_property(){
    OW :: getDocument()-> addMetaInfo('og:type','website','property');
    OW :: getDocument()-> addMetaInfo('og:title','这里的标题太棒了','property'); } OW :: getEventManager()-> bind(OW_EventManager :: ON_BEFORE_DOCUMENT_RENDER,'modify_custom_meta_property');

清除您的网站缓存并查看页面的源代码,现在应该添加正确的meta,而错误的meta消失了。

相关问题