[WordPress] 外掛分享: Override Post Title with First Content Heading

前言介紹

  • 這款 WordPress 外掛「Override Post Title with First Content Heading」是 2009-09-27 上架。
  • 目前有 80 個安裝啟用數。
  • 上一次更新是 2009-12-21,距離現在已有 5910 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 2.7 以上版本才可以安裝。
  • 尚未有人給過這款外掛評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

westonruter |

外掛標籤

h1 | h2 | seo | title | heading |

內容簡介

這個外掛是由Shepherd Interactive所開發,並針對社群發展。沒有提供支援。
請到支援論壇發問。

通常在迴圈(The Loop)中,當在單一文章/頁面使用the_title()時,將會回傳post_title;但是,如果需要覆蓋原本的標題,例如為了SEO,可以在post_content的開頭加入h1或h2元素,並放入自訂的內容標題,則the_title()將會回傳這個自訂的標題,而非原本的文章/頁面標題。

從技術面來看,根據HTML5,主標題(site title)應使用h1元素,而每篇文章/頁面的標題(page/post title)應放在article元素內使用h2元素:

雖然章節內包含任何等級的標題,但是建議作者要麼只使用h1元素,要麼使用適當級別的標題元素表達章節層次。

這在預設的WordPress佈景主題和HTML標準中都有體現。但是,由於SEO更重視h1元素的內容,所以如果網站的每個頁面都使用相同的h1內容(網站名稱),則搜索引擎可能不會根據h2元素的獨特內容排名頁面。因此有建議將h1和h2元素交換,讓網站名稱放在h2中,而讓獨特頁面標題放在h1中。儘管HTML5沒有優先考慮這種安排,但也是正確且合法的:

這兩個文件在語義上是等價的,在符合標準的用戶端上會產生相同的大綱。

因此,如果不同標題級別在語義上是等價的,並且搜索引擎真的將這麼重要的權重放在h1上,那麼SEO就勝出了。

在兩種情況下,內容區域的標題應該使用h3及以下元素。

技術注意事項:如果沒有將$post物件傳遞到the_title過濾器,則必須在每次使用the_title()前呼叫頁面的the_title(),而且必須包含在迴圈(in_the_loop())中。

原文外掛簡介

This plugin is developed at
Shepherd
Interactive for the benefit of the community. No support is available.
Please post any questions to the support
forum.
On a singular post/page, normally in The Loop the_title() returns
post_title; if, however, this needs to be overridden so that a
custom content heading is displayed (i.e. for SEO purposes), then an
h1 or h2 element may be supplied at the beginning of
the post_content and the contents of this heading element
will be returned by the_title() instead of post_title.
From a technical perspective, the site title in the main header should be
an h1 element and the page/post title should in an h2
element within an article, per HTML5:
Sections may contain headings of any rank, but authors are strongly
encouraged to either use only `h1` elements, or to use elements of the
appropriate rank for the section’s nesting level.
This is seen in the default WordPress theme and the HTML specifications. However,
SEO places higher priority on the contents of an h1 element, so if
every page of a site has the exact same h1 contents (the site name),
then search engines may not be as likely to rank the page based on the unique
contents of the h2. It has been suggested
therefore that the h1 and the h2 elements be swapped,
so that the site title appears in an h2 and so that the unique page
title appears in the h1. While the specifications don’t prefer this
arrangement, it is not incorrect, also per HTML5:
Both of the documents are semantically identical and would produce the same
outline in compliant user agents.
So if different heading levels are semantically equivalent, and if search
engines really place that much importance on h1, then SEO wins.
In both cases, content section headings should be coded with h3 and
below.
Technical note: If the $post object is not passed into the_title
filter, then the page’s the_title() must be called before every other
the_title() call in_the_loop()

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Override Post Title with First Content Heading」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


最新版本

延伸相關外掛(你可能也想知道)

  • Title Remover 》重要提示:此外掛適用於每個使用建議 WP 函數顯示標題的佈景主題。對於使用較少知名方法顯示標題的其他佈景主題,可能無法使用此外掛。, 這個外掛會在 WordPr...。
  • Hide Title 》這個外掛能讓一篇文章或頁面的作者隱藏標題及其對應的 HTML 元素,讓單獨檢視該文章或頁面時 (is_singular()) 不會顯示標題。。
  • WP Subtitle 》WP Subtitle 外掛能讓你的頁面和文章擁有副標題。這個短小的文字通常出現在文章(或頁面)標題之下,也可以在你選擇的任何地方插入你的樣板。, 你可以使用以...。
  • Secondary Title 》Secondary Title 是一個簡單、輕量的外掛,為文章、頁面或自定義文章類型添加替代標題,這些標題可以自動顯示、使用簡碼或使用 PHP。, 此外掛還提供額外的設...。
  • Genesis Title Toggle 》此外掛僅與 Genesis 主題相容,請勿在未使用 Genesis 主題的網站上安裝。, 此外掛可讓您輕鬆地從特定頁面中移除頁面標題。不想在首頁頂部出現「Home」?啟動...。
  • Button visually impaired 》, Button visually impaired* is a plugin that automatically changes the version of your website for visually impaired people., , The panel for visua...。
  • rus to lat advanced 》這款 WordPress 外掛將俄文標題的文件名和連結(從標題中建立)轉換為拉丁字母。俄文標題的文件名和連結在 WordPress 中儲存時經常是不正確的。, 例如,在標...。
  • Smart SEO Tool – SEO优化插件 》Smart SEO Tool是一款专门针对WordPress开发的智能SEO优化插件,与众多WordPress的SEO插件不一样的是,Smart SEO Tool更加简单易用,帮助站长快速完成WordPre...。
  • Title Limit for WooCommerce 》這款 WordPress 外掛可以讓使用者在 WooCommerce 的商店、分類、標籤、產品頁面和首頁中,設定產品標題的最大長度。, 透過此外掛,可以避免過長的產品標題造...。
  • Format Media Titles 》格式化媒體標題 WordPress 外掛可以讓你為新上傳的媒體項目格式化標題。手動編輯新上傳的媒體項目的標題可能會相當繁瑣。這個外掛可以自動從標題中刪除和替換...。
  • Better Aria Label Support 》提升 WordPress 對於 aria-label 的支援,目前僅針對選單項目,未來會提供更多功能!, 首要的步驟:此外掛會在 WordPress 選單畫面中,取代「標題」欄位為「A...。
  • Subtitles 》現在 WordPress 目前沒有簡單的方法供網站發布者在他們的文章、頁面和其他自訂文章類型中添加副標題。這讓使用者和開發者陷入困境,試圖找出如何以美觀和合理...。
  • Title Toggle for Storefront Theme 》, 這個外掛讓您可以輕鬆地從特定頁面或文章中移除頁面標題。最基本的使用情境是隱藏您在 “Home” 頁面中所設定的標題。, 此外掛只適用於 Storefro...。
  • Restore Link Title Field 》在 WordPress 核心票 #28206 中,編輯器被修改為具有連結文字欄位而非標題欄位。, 此外掛可將標題欄位加回來。。
  • HeadSpace2 SEO 》HeadSpace2 是一個全方位的元數據管理器,讓您可以精細調整網站的 SEO 潛力。造訪HeadSpace頁面,了解更多功能與演示影片。, 您可以配置如下的元數據:, , 文...。

文章
Filter
Apply Filters
Mastodon