天天看點

如何在WordPress中切換/轉換自定義文章類型

WordPress comes with five default post types, which are posts, pages, attachments, revisions and menus. Users can also create their own custom post types. This gives them power to create different types of content and display them differently on their websites. Recently we found a need to merge two custom post type into one for a client’s project. In this article, we will show you how to switch custom post types without writing any code. Suppose if you created a post and wanted to covert it into a page, or a vice-versa, then you would be able to do this by following this tutorial. If you want to switch from one custom post type to another, then you would be able to do that as well. Lastly, you will be convert multiple post types at once which will allow you to save a lot of time.

WordPress帶有五種預設的文章類型,分别是文章,頁面,附件,修訂和菜單。 使用者還可以建立自己的自定義文章類型 。 這使他們能夠建立不同類型的内容并在其網站上以不同的方式顯示它們。 最近,我們發現有必要将兩種自定義文章類型合并為一個客戶項目。 在本文中,我們将向您展示如何在不編寫任何代碼的情況下切換自定義文章類型。 假設您建立了一個文章并希望将其隐藏到頁面中,反之亦然,那麼您可以按照本教程進行操作。 如果您想從一種自定義文章類型切換到另一種,那麼您也可以做到這一點。 最後,您将一次轉換多種文章類型,這将節省大量時間。

影片教學 (Video Tutorial)

示範位址

If you don’t like the video or need more instructions, then continue reading.

如果您不喜歡該視訊或需要更多說明,請繼續閱讀。

First thing you need to do is install and activate the Post Type Switcher plugin. Post Type Switcher adds an option to switch post type of a specific post by going to the post edit screen or manage posts area. On the edit screen of your post or another post type, you will see a drop down under the “Publish” meta box. Choose the post type you want to switch to and click the update button.

您需要做的第一件事是安裝并激活Post Type Switcher插件。 文章類型切換器添加了一個選項,可通過轉到文章編輯螢幕或管理文章區域來切換特定文章的文章類型。 在文章或其他文章類型的編輯螢幕上,您将在“釋出”元框下看到一個下拉清單。 選擇您要切換到的文章類型,然後單擊更新按鈕。

如何在WordPress中切換/轉換自定義文章類型

You can also quickly change an individual post’s type from the Quick Edit screen while viewing all posts:

您還可以在檢視所有文章時從“快速編輯”螢幕快速更改單個文章的類型:

如何在WordPress中切換/轉換自定義文章類型

Post Type Switcher also allows you to switch post type for multiple posts by editing them in the bulk action mode. Follow these steps:

文章類型切換器還允許您通過在批量操作模式下編輯多個文章來切換它們的文章類型。 跟着這些步驟:

  1. All Posts所有文章
  2. Select the posts you want to change

    選擇您要更改的文章

  3. Edit and press the 編輯” ,然後按“ Apply button.應用”按鈕。
  4. Now you will see all selected posts in quick edit mode. Review the posts you have selected and then change the post type as needed.

    現在,您将在快速編輯模式下看到所有標明的文章。 檢視您選擇的文章,然後根據需要更改文章類型。

如何在WordPress中切換/轉換自定義文章類型

轉換多種文章類型進階模式 (Converting Multiple Post Types Advanced Mode)

Post Type Switcher is a quicker and a simpler solution. However, there might be situations where you would need to select post types in a particular category, tag, or post types with a particular post format. In such situations you can use Convert Post Types plugin. Install and activate this plugin. Upon activation, a new “Convert post types” menu item will appear under Tools. You will notice that it is a powerful plugin, which allows you to do so many things and select posts by filtering them into categories, parent pages, tags, etc.

郵政類型切換器是一種更快,更簡單的解決方案。 但是,在某些情況下,您可能需要選擇特定類别,标簽或具有特定文章格式的文章類型的文章類型。 在這種情況下,您可以使用“ 轉換文章類型”插件。 安裝并激活此插件。 激活後,新的“轉換文章類型”菜單項将出現在“工具”下。 您會注意到它是一個功能強大的插件,通過它您可以按類别,父頁面,标簽等将其過濾,進而做很多事情并選擇文章。

如何在WordPress中切換/轉換自定義文章類型

If you ever wanted to switch a post to a page in WordPress, convert a page into a post, or merge two custom post types into one, then we hope that you found this article helpful. If you have any questions, then please leave them in the comments. If you have used other methods to convert post types in WordPress, then share it with us in the comments below.

如果您想在WordPress中将文章切換到頁面,将頁面轉換為文章,或将兩種自定義文章類型合并為一種,那麼我們希望本文對您有所幫助。 如有任何疑問,請保留在評論中。 如果您使用其他方法在WordPress中轉換文章類型,請在下面的評論中與我們分享。

翻譯自: https://www.wpbeginner.com/plugins/how-to-convert-post-types/