Custom Post Types

Components CPT

TF has one built in CPT: Components. Components are for content blocks that are used via PHP to build custom pages. Keeping these out of WP Pages helps keep them off of sitemaps etc.

The Components code is in TF, but to enable it add this to the CHILD functions.php file:

add_action( ‘init’, ‘cpt_components’, 0 );

Configuration Notes

If something not right, reset permalinks

Disable Yoast SEO admin metabox in Yoast settings: Titles & Meta / Post Types

Disable from Yoast XML sitemap in Yoast SEO settings

Remove from robots.txt with (not yet tested!):

Disallow: *components*

Starter code for other CPTs

In the child theme the tf_child_cpt_example.php file has sample code for a CPT, with custom fields, and with a custom taxonomy. Copy it to another file and away you go.

Configuration Notes

The first time linking in the code, or when changing the “public” CPT parameter, reset permalinks

Disable Yoast SEO admin metabox in Yoast settings: Titles & Meta / Post Types

Disable from Yoast XML sitemap in Yoast SEO settings

Remove from robots.txt with (not yet tested!):
Disallow: *components*

Other Use Examples

See ASHI for custom taxonomies applied to users, and for taxes to be applied to multiple CPTs.

See Arons for CTP with custom tax, and linked to product taxonomy

See tatkin for live Components use (although it’s not using TF as a parent theme).

See berkeleycycleworks. for components in use with full TF parent / child.