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

前言介紹

  • 這款 WordPress 外掛「Override Post Title with First Content Heading」是 2009-09-27 上架。
  • 目前有 90 個安裝啟用數。
  • 上一次更新是 2009-12-21,距離現在已有 5612 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 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 環境。


最新版本

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

  • In This Article 》總結:In This Article 外掛幫助你列出文章內 h2 和 h3 的標題,以有序結構呈現,讓使用者輕鬆在文章中導覽。透過簡單的短碼,你可以在單獨的部落格文章頁面...。
  • Inesta FAQ H2 》總結:Inesta FAQ H2 是一款輕量化的外掛程式,旨在提升您的Yoast或Power Pack FAQ區塊,將預設問題標籤從元素轉換為

    標題。這有助於通...。

  • Image Heading 》。

文章
Filter
Apply Filters
Mastodon