How to add new item on Code.Market – Codemarket

How to add new item on Code.Market

Custom Post Type Templates
archive-{post_type}.php
single-{post_type}.php
archive-{post_type}.php
If your custom post type were ‘product’, and/or query_var = “product”, WordPress would look for archive-product.php to display the archive of posts.
single-{post_type}.php
If your custom post type were ‘product’, and/or query_var = “product”, WordPress would look for single-product.php to display the single or permalink of the post.
If these files are not available in your Theme’s directory WordPress will look for archive.php and single.php, respectively. If even these files are not present it will default to index.php. See Template Hierarchy for more details.

Examples
Make a copy of the single.php or archive.php file as a starting point. That way they will inherit some of the theme’s html structure. Remember to add the post type name to the file ex. archive-post_type.php. From there you may want to customize further…

Displaying Custom Taxonomies
If you are using custom taxonomies with your post type and would like them to display in your template file use the_terms().

Listing Post Type Pages
If a given custom post type is hierarchical in nature, then wp_list_pages() can be used to list the member of that custom post type.

Conditional tags for Custom Post Types
Fun with conditional statements… Conditional tags for Custom Post Types

Related