Conflict in function to allow single post template based on category

You can check for your post type single-{post-type}.php first try this:

/* Define a constant path to our single template folder */
define(SINGLE_PATH, TEMPLATEPATH . '/single');

/* Filter the single_template with our custom function*/
add_filter('single_template', 'my_single_template');

/* Single template function which will choose our template*/
function my_single_template($single) {
    global $wp_query, $post;

/* Checks for single template by post type */
if ($post->post_type == "POST TYPE NAME"){
    if(file_exists(SINGLE_PATH . '/single-' . $post->post_type . '.php'))
        return SINGLE_PATH . '/single-' . $post->post_type . '.php';
}

/* Checks for single template by category. Check by category slug and ID */
foreach((array)get_the_category() as $cat) :

    if(file_exists(SINGLE_PATH . '/single-cat-' . $cat->slug . '.php'))
        return SINGLE_PATH . '/single-cat-' . $cat->slug . '.php';

    elseif(file_exists(SINGLE_PATH . '/single-cat-' . $cat->term_id . '.php'))
        return SINGLE_PATH . '/single-cat-' . $cat->term_id . '.php';

endforeach;

/*Checks for default single post files within the single folder */
if(file_exists(SINGLE_PATH . '/single.php'))
    return SINGLE_PATH . '/single.php';

elseif(file_exists(SINGLE_PATH . '/default.php'))
    return SINGLE_PATH . '/default.php';

return $single; 
}

and just replace “POST TYPE NAME” with your custom post type name.

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