I am developing a WordPress custom-theme where I would like to register my Custom Post Type and Taxonomy upon theme install, I have all the generated cpt-code inside my ~custom-theme/custom/posttypes.php and taxonomy.php See it here on Pastebin.
I am very new a PHP but know that I must put some add_action
or enqueue function inside my functions.php
file so this post type will get registered on theme activation.
The function name in this example for the PostType is function cptui_register_my_cpts_testimonials()
and for the Taxonomy is function cptui_register_my_taxes_client-types()
The reason I don't want all this code inside function.php
is it will get too long, so hoping for a way to just fire this with a line or two of code from my functions.php
file.