【问题标题】:Oxwall - Remove meta tagsOxwall - 删除元标记
【发布时间】:2020-06-28 12:11:21
【问题描述】:

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

错误值(由 Oxwall 生成):

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

正确值:

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

提前致谢

【问题讨论】:

    标签: html meta oxwall


    【解决方案1】:

    您可以在基本或插件 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');
    

    【讨论】:

      【解决方案2】:

      我终于找到了解决办法。

      你必须这样做:

      1. 转到 ow_system_plugins/base/classes/event_handler.php 并在文件末尾删除或注释掉添加错误 facebook 元的所有行:

      例子:

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

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

        函数 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');

      清除您的网站缓存并查看您页面的源代码,现在应该添加正确的元数据并且错误的元数据已消失。

      【讨论】:

        猜你喜欢
        • 2015-01-31
        • 2011-04-06
        • 2013-05-24
        • 2014-07-02
        • 2015-03-18
        • 2011-06-07
        • 1970-01-01
        • 1970-01-01
        • 2016-04-04
        相关资源
        最近更新 更多