【问题标题】:Remove Archive: from Events Page title删除存档:从活动页面标题
【发布时间】:2018-08-29 07:25:38
【问题描述】:

我已经被这个问题困扰了很长一段时间了,我不知道该怎么办了。我试图用谷歌搜索这个问题,但没有任何解决方案(CSS 和 PHP)有帮助。

谁能帮我只删除页面标题中的“存档:”部分?

我正在使用事件日历插件。 https://wordpress.org/plugins/the-events-calendar/

谢谢!

【问题讨论】:

  • 您是否使用 Yoast SEO 插件进行了测试以删除此问题?
  • 没有。不知道怎么用

标签: php wordpress plugins


【解决方案1】:

这实际上取决于您使用的主题。尝试从您的 Archive.php 页面搜索标题​​功能。

快速修复!将此添加到您的 CSS 中。

body.post-type-archive-tribe_events .page-title .col-md-12.page-title-container h1 { display: none !important; } 

【讨论】:

  • 你能帮我删除或隐藏这些页面吗?我做了一些示例事件并检查了事件详细信息页面。但它也会在此页面上查看。
  • 请分享您的网站链接和主题名称
  • 快速修复!将此添加到您的 CSS 中。
  • body.post-type-archive-tribe_events .page-title .col-md-12.page-title-container h1 { display: none !important; }
  • 嗨@Shaharyar,也请检查此链接。我怎样才能删除这些? acboa.lk/events/annual-general-meeting-2018
【解决方案2】:

请使用 Yoast SEO 插件。参考:https://en-gb.wordpress.org/plugins/wordpress-seo/

活动日历文档为您提供full instruction,告诉您如何按照您的要求行事。

安装一个 WordPress 子主题,在 子主题 functions.php 文件中粘贴:

    // Prevent Yoast from changing Event Title Tags for Event Views (Month, List, Etc,)
    add_action( 'pre_get_posts', 'tribe_remove_wpseo_title_rewrite', 20 );
    function tribe_remove_wpseo_title_rewrite() {
        if ( class_exists( 'Tribe__Events__Main' ) && class_exists( 'Tribe__Events__Pro__Main' ) ) {
            if( tribe_is_month() || tribe_is_upcoming() || tribe_is_past() || tribe_is_day() || tribe_is_map() || tribe_is_photo() || tribe_is_week() ) {
                $wpseo_front = WPSEO_Frontend::get_instance();
                remove_filter( 'wp_title', array( $wpseo_front, 'title' ), 15 );
                remove_filter( 'pre_get_document_title', array( $wpseo_front, 'title' ), 15 );
            }
        } elseif ( class_exists( 'Tribe__Events__Main' ) && !class_exists( 'Tribe__Events__Pro__Main' ) ) {
            if( tribe_is_month() || tribe_is_upcoming() || tribe_is_past() || tribe_is_day() ) {
                $wpseo_front = WPSEO_Frontend::get_instance();
                remove_filter( 'wp_title', array( $wpseo_front, 'title' ), 15 );
                remove_filter( 'pre_get_document_title', array( $wpseo_front, 'title' ), 15 );
            }
        }
    };

【讨论】:

  • 嗯,我认为这不是插件问题。
  • 我认为你误解了我的帖子。 Yoast SEO 将允许您轻松更改您引用的存档标题。要么是那个,要么你引用了页面的 元标记以外的东西。
猜你喜欢
  • 1970-01-01
  • 2017-08-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-01-31
相关资源
最近更新 更多