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


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:

Post Type Content Page:

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(
        'rewrite' => array( 'slug' => 'cat-breeds' ),
        'show_in_rest' => true,
    register_post_type( 'cat_breeds', $args );
add_action( 'init', 'post_type_cat_breeds' );

Murat Dinc 1 year 2022-08-28T13:42:30-05:00 0 Answers 0 views 0

Leave an answer