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

[ad_1]

Hi. 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’ );

[ad_2]
1 Comment
  1. Looks like it’s working well! Not sure what you’re trying to do. Add the name and link of what to which template where? Are you asking how to add categories to your custom post type?

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer