You can’t use the category name to search for categories. You can use the slug. Be aware of the difference. A slug is normalized to lower case with spaces replaced by dashes. The slug for “Foo A” would be “foo-a”. Using “Foo A” will not work.
$admin_cat = get_option('admin_cat');
if (ctype_digit("$admin_cat")) { // this is an ID
$qry = array('cat' => (int)$admin_cat);
} else {
$qry = array('category_name' => $admin_cat);
}
$my_query = new WP_Query($qry);
As stated in a comment to your question, do not use query_posts
.
It should be noted that using this to replace the main query on a page
can increase page loading times, in worst case scenarios more than
doubling the amount of work needed or more. While easy to use, the
function is also prone to confusion and problems later on. See the
note further below on caveats for details.http://codex.wordpress.org/Function_Reference/query_posts (emphasis mine)