內容簡介
此外掛可匯入格式完整的靜態 HTML 檔案到 WordPress。需要 PHP 5 及以上版本。
此插件可將一個目錄的檔案匯入為頁面或文章。您可以指定包含您想匯入內容的 HTML 標籤(例如 <body>、<div id="content"> 或 <td width="732">)或 Dreamweaver 模板區域(例如「主要內容」)。
如欲匯入為頁面,目錄階層將會保留。包含指定檔案類型的目錄將會匯入為空白的母頁面(或,如果存在索引檔案,則使用其內容作為母頁面)。不包含指定檔案類型的目錄將會被忽略。
當檔案被匯入時,相應的 ID、永久連結和標題將被顯示。完成後,匯入程式將提供一個 Apache 重定向清單,供您在 .htaccess 檔案中使用,以無縫地將訪客從舊檔位置轉移到新的 WordPress 永久連結。自 2.0 版本開始,如果您在匯入檔案後更改了永久連結結構,您可以重新產生重定向清單 – 匯入檔案的舊 URL 存儲在匯入的文章的自訂欄位中。
選項:
將檔案匯入到任何文章型態中(如:文章、頁面或設為public的自定文章型態)
匯入連結的媒體檔案(如:影像和文件)到媒體庫中
按 HTML 標籤或 Dreamweaver 模板區域選取內容、標題和自訂欄位
從匯入的標題中刪除常見片語(如:網站名稱)
從內容區域中刪除匯入的標題
上傳單一檔案或掃描檔案匯入到目錄中
指定要匯入的檔案擴展名(如:html、htm、php)
指定要排除的目錄(如:圖像、CSS)
如果匯入頁面(或任何具階層性的文章型態),可指定您的頂級檔案是否成為頂級頁面或現有頁面的子頁面
指定索引檔案名稱(例如 index.html、default.htm),其內容應用於目錄母頁面
設置標籤、分類和自定稅項目
選擇狀態、作者和時間戳記
使用 Meta 描述作為摘要
清理匯入的 HTML,並刪除內容和自訂欄位中不需要的標籤和屬性
修正匯入的檔案內部連結以符合新的永久連結
匯入整個檔案並從檔名產生標題
保留原始檔名作為匯入頁面的別名
從 HTML 標籤或 Dreamweaver 區域選擇日期(使用 strtotime(),結果可能會有所不同)
匯入其他 HTML 標籤或 Dreamweaver 區域作為自訂欄位
從內容區域中刪除匯入的標題
後備方案:如果您選擇的標籤/區域是空的或不存在,匯入程式將選擇使用 <body> 作為內容並使用 <title> 作為標題
使用名為「post_tag」的自訂欄位來匯入標籤
有關所有選項的詳細信息,請查閱 User Guide。
鳴謝
鳴謝:
Tom Dyson 的 Wordoff.org,其激發了 1.1 版本中 Word 清理選項的靈感。
Dion Hulse 的 Add from Server 插件和 bbqiguana 的 Add Linked Images to Gallery 插件提供了匯入媒體檔案的啟發。
這個社群中的所有使用者 - 每個人的詳細反饋和智慧意見都有助於這個插件的改進。
外掛標籤
開發者團隊
原文外掛簡介
Imports well-formed static HTML files into WordPress. Requires PHP 5.
This plugin will import a directory of files as either pages or posts. You may specify the HTML tag (e.g.
If importing pages, the directory hierarchy will be preserved. Directories containing the specified file types will be imported as empty parent pages (or, if an index file is present, its contents will be used for the parent page). Directories that do not contain the specified file types will be ignored.
As files are imported, the resulting IDs, permalinks, and titles will be displayed. On completion, the importer will provide a list of Apache redirects that can be used in your .htaccess file to seamlessly transfer visitors from the old file locations to the new WordPress permalinks. As of 2.0, if you change your permalink structure after you’ve imported your files, you can regenerate the redirects—the file’s old URL is stored as a custom field in the imported post.
Options:
import files into any post type (posts, pages, or custom post types set to public)
import linked media files (images, documents, etc.) to the media library
select content, title, and custom fields by HTML tag or Dreamweaver template region
remove a common phrase (such as the site name) from imported titles
remove the imported title from within the content area
upload a single file or scan a directory for files to import
specify file extensions to import (e.g. html, htm, php)
specify directories to exclude (e.g. images, css)
if importing pages (or any hierarchical post type), specify whether your top-level files should become top-level pages or children of an existing page
specify index file names (e.g. index.html, default.htm) whose contents should be used for the directory parent pages
set tags, categories, and custom taxonomies
choose status, author, and timestamp
use meta descriptions as excerpts
clean up imported HTML and strip unwanted tags and attributes in content and custom fields
fix internal links in imported files to match new permalinks
import the entire file and generate the title from the filename
preserve the original filename as the imported page’s slug
choose the date from an HTML tag or Dreamweaver region (uses strtotime(); results may vary)
import additional HTML tags or Dreamweaver regions as custom fields
option to remove imported title from within content area
fallbacks: if your chosen tag/area is empty or does not exist, the importer will select
use a custom field named ‘post_tag’ to import tags from a portion of the file
See the User Guide for details on all the options.
Thanks
Thanks to…
Tom Dyson’s Wordoff.org for inspiring the Word cleanup option in 1.1.
Dion Hulse’s Add from Server plugin and bbqiguana’s Add Linked Images To Gallery plugin, from which I borrowed a lot of the logic behind the image import feature in 2.0
