![]() To explain, the child theme will keep all our registered CPTs and other changes safe when updating the Astra theme. For this reason, we will register our CPT to the functions.php file of the Astra Child Theme. The issue with this is that your CPTs will be removed with every theme update. To register a CPT you need to add a few lines of code to the functions.php file of your Astra theme. Also, you can add an unlimited number of CPTs to your website. You can register your custom post type and give them any name you want. Now, let’s show you how to register our Sessions CPT. If you need any assistance importing the template, you can check this document. Also, you can import the “ Businessly” Starter Template to your website. In addition, we’ll set the “Interactive Sessions” page as an archive for displaying Sessions.īefore starting, make sure you have your Astra theme and your Astra Child Theme set. We will show you how to create a CPT containing these options. Each session has some specific information like dates, host, and speaker. The template we will use contains an “Interactive Sessions” page. To illustrate, we will import the “ Businessly” Starter Template and create an additional CPT called Sessions. Also, each CPT has a custom taxonomy that can help you improve the way your content is organized. For example, you can add a CPT with a custom layout and functionality making it suitable for non-standard content. Adding Custom Post Type (CPT)Īdding CPTs to your website can bring a lot of advantages. Thus, you have the option to add a completely new post type and shape it based on your needs. You might wonder why you need Custom Post Type (CPT)? Simply put, in some situations adding content to existing post types and templates can’t provide the needed result. ![]() Hence, this document will show you how to create a custom post type that works perfectly with the Astra theme. ![]() In addition, you can even use astra_content_loop() to add your custom content to any existing post type. The Astra theme is famous for its flexibility.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |