專注於架設企業網站,分享WordPress教學和Elementor教學

Elementor如何隱藏頁面上的標題(2種辦法)【視頻】

更新日期:2023-08-25
加入讀者學習群
我用的頁面編輯器
讓我的客戶網站GTmetrix測分A\A的主機Cloudways
獨家優惠前3個月7折, 戳上方按鈕註冊即可自動帶入優惠碼LOYSEO
所贈主題外掛程式價值>$49
主機送Astra Pro不限網站1年
gmail.comsina.com 郵箱,註冊易通過
遇到問題,聯繫我
來開通 SEO 工具20+

本文介紹兩種隱藏Elementor頁面默認標題的方法,一種是單個隱藏,一種是全局隱藏(適用於hello elementor和astra主題)。

下圖是隱藏標題前後的區別,所用的主題是Hello elementor。

hello elementor %E5%8E%BB%E6%8E%89%E5%85%A8%E5%B1%80%E9%BB%98%E8%AE%A4%E6%A0%87%E9%A2%98

2020-11-29更新:針對Hello Elementor主題去頁面標題的的視頻教程

如何單個隱藏頁面標題

下面介紹禁用Elementor頁面標題的操作步驟

  1. 在elementor編輯頁面時,點擊左下角的設置按鈕
  2. 然後將隱藏標題開關開啟即可

disable-page-title

如果隱藏標題不起作用,那麼應該跟你用的主題有關,你需要去elementor全局設置中修改頁面標題選擇器。

首先打開一篇文章,然後按照下面動圖的兩種方法任一個,去找到h1標籤的class,多個class之間是空格隔開的,一般取第一個,如下圖所示,我們得到h1的class是page-title-header,那麼頁面標題選擇器是h1.page-title-header

get-page-title-selector

然後將它填入到elementor全局設置的頁面標題選擇器中,保存即可。

elementor-page-title-selector-setting

如何全局隱藏頁面標題

本方法僅適用於Hello elementor和Astra主題。

安裝並啟用外掛程式Code snippets,這裡有外掛程式安裝教程,然後按下面步驟操作

  1. 進入 Snippets > add new
  2. 輸入標題,例如:禁用頁面默認標題
  3. 輸入如下代碼

適用於hello elementor主題的代碼

function ele_disable_page_title( $return ) {
   return false;
}
add_filter( 'hello_elementor_page_title', 'ele_disable_page_title' );

適用於 astra主題的代碼,原文鏈接https://wpastra.com/docs/disable-title-from-pages-2/

/* Disable title on all post types. */ 
  function your_prefix_post_title() { 
     $post_types = array('page'); 
     // bail early if the current post type if not the one we want to customize. 
 if ( ! in_array( get_post_type(), $post_types ) ) { return; } // Disable Post featured image. 
 add_filter( 'astra_the_title_enabled', '__return_false' ); 
 }
 add_action( 'wp', 'your_prefix_post_title' );

  1. 選擇 only run on site front-end
  2. 點擊save changes保存

hello elementor %E5%8E%BB%E6%8E%89%E5%85%A8%E5%B1%80%E9%BB%98%E8%AE%A4%E6%A0%87%E9%A2%98 2
点赞
0 / 5 0

Your page rank:

外貿建站技術姐Bonnie
外貿建站技術姐Bonnie

Bonnie是LOYSEO的創始人,在建站領域有著超過14年的經驗,熱愛能將想法變為現實的WordPress,更是Elementor的忠實使用者~

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

LOYSEO