How do I call the custom Post Type name and permanent link to my php file?

Question

I’ve added a Custom Post Type to my site, but I can’t figure out what to type when I want to add the name and link to my template file as a category. How do I call up Post Type name and address from my php file?

Post Type Home Page: https://wisekitten.com/cat-breeds/

Post Type Content Page: https://wisekitten.com/cat-breeds/york-chocolate/

The codes are as follows;

function post_type_cat_breeds() {
    $labels = array(
        'name' => 'Cat Breeds',
        'singular_name' => 'Cat Breed'
    );
    $args = array(
        'labels' => $labels,
        'has_archive' => true,
        'public' => true,
        'hierarchical' => false,
        'supports' => array(
            'title',
            'editor',
            'excerpt',
            'author',
            'custom-fields',
            'thumbnail',
            'comments',
        ),
        'rewrite' => array( 'slug' => 'cat-breeds' ),
        'show_in_rest' => true,
    );
    register_post_type( 'cat_breeds', $args );
}
add_action( 'init', 'post_type_cat_breeds' );

0
Murat Dinc 4 weeks 2022-08-28T13:42:30-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse