How to determ a custom post type url?

You need to register a custom taxonomy for you custom post type.

For example:

add_action('init', 'register_book_taxonomy');
function register_book_taxonomy() {
    $labels = array(
        'name' => 'Book Categories',
        'singular_name' => 'Book Category',
        'search_items' => 'Search Book Categories',
        'all_items' => 'All Book Categories',
        'parent_item' => 'Parent Book Category',
        'parent_item_colon' => 'Parent Book Category:',
        'edit_item' => 'Edit Book Category',
        'update_item' => 'Update Book Category',
        'add_new_item' => 'Add New Book Category',
        'new_item_name' => 'New Book Category Name',
        'menu_name' => 'Book Categories',
    );

    $args = array(
        'hierarchical' => true, // Works like categories
        'labels' => $labels,
        'show_ui' => true,
        'show_admin_column' => true,
        'query_var' => true,
        'rewrite' => array('slug' => 'book-category'), // URL slug for the taxonomy
    );

    register_taxonomy('book_category', array('ptbook'), $args);
 }

Then you can create categories, and assign posts (custom posts) to it.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)