If you’re using custom post types on your website, here are some things to know about using them with Headway.
Where to Add a Custom Post Type Function
One way to implement custom post types is by manually adding a new function. (An alternative is installing a custom post type plugin.) However, the functions.php file in Headway Base isn’t a good place for this because your changes will be overwritten when you update the theme and you can break Headway and white screen your site.
Instead, create and activate a child theme, and edit the functions.php file in that theme.
Showing Headway SEO Options for Custom Posts
If you add custom post types by editing the functions.php file and you want the Headway SEO meta box to appear when editing your custom posts,
add “headway-seo” to the supported parameters:
'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments', 'headway-seo')
If you wanted to add support for the other Headway meta boxes:
|Headway Call/Code||Meta Box|
||Featured Image position|
||Custom CSS Class(es)|
Displaying a Custom Post Loop
Posts with a custom type won’t appear in the default loop on your blog index. But since the purpose of custom post types is to separate them from the regular posts, you can display the custom posts either on a page or as an archive. The method you choose depends mostly on how you want layout inheritance to affect the display—in other words, do you want the custom post types to look like your other WordPress pages or your other
Note: Posts with a custom type also don’t appear in your RSS feed. See this wpbeginner article to add them.
- Create a page in WordPress for your posts.
- In Grid Mode of the Visual Editor, set up a custom query for the content block. The query should get posts of your custom type.
- In WordPress, add a navigation menu item that points to the page.
- In Grid Mode, verify that your custom post layout is inheriting a layout where the content block is using the default query.
- In WordPress, add a navigation menu item that points to the archive.