Looking up custom taxonomy IDs by name

I just ran a quick test on a site that uses custom taxonomies. The sample code that you used works for me.

I did the following

$test_term_by = get_term_by('name', 'Sample Name', 'my-custom-taxonomy');

// note that this produces a "stdclass object", not an array.

echo '<pre>';
print_r($test_term_by);
echo '</pre>';

echo $test_term_by->term_taxonomy_id; // one of the values of our object.

Perhaps you want to do some testing with the get_term_link( $term, $taxonomy ) function, which is a bit more straightforward in it’s output, and can be useful for your debugging.

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