I was looking for the same thing, and did not find what the fact that you are trying to do, even this thread, actually answers. At least they are close here, but they still violate some of the functionality of your question code. However, I have been working on this for several hours, and as a rule, the longer you work on it, the easier the solution will be.
I made the assumption that you are trying to use WP_Query to select and display messages from a category selected on your new options page, like me. I found that WP_Query doesn't like recursively sifting categories if you use a name, but it will if you use cat_ID ... even when using get_cat_ID. So, firstly, here is my WP_Query, which appears on my front-page.php
<?php $feat1= get_option('twp_feat_cat'); //this is the id of your option in the mega array you setup in functions.php $args=array('cat' => $feat1,'post_type' => 'post','post_status' => 'publish','posts_per_page' => 2,'caller_get_posts'=> 1); $my_query = null; $my_query = new WP_Query($args); $post_counter = 0; //so I can style last post differently with css if( $my_query->have_posts() ) { while ($my_query->have_posts()) : $my_query->the_post(); $post_counter++; ?> <article id="post-<?php the_ID(); ?>" <?php if ($post_counter == 1) post_class('fourcol first clearfix'); elseif ($post_counter == count( $posts )) post_class('fourcol last clearfix'); else post_class('fourcol clearfix'); ?> role="article"> <header class="article-header"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2> </header> <!-- end header section --> <section class="entry-content clearfix"> <?php $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'original' ); $url = $thumb['0']; echo do_shortcode( '[rimg src="' . $url . '"]' ); ?> <?php the_excerpt(); ?> </section> <!-- end article section --> <footer class="article-footer"> <p class="tags"><?php //the_tags('<span class="tags-title">' . __('Tags:', 'bonestheme') . '</span> ', ', ', ''); ?></p> </footer> <!-- end article footer --> </article> <?php endwhile; } wp_reset_query(); // Restore global post data stomped by the_post(). ?>
This snippet takes cat_ID from my theme options page and puts it in $feat1
Only two changes needed for your functions.php from the original change this:
$wp_cats[$category_list->cat_id] = $category_list->cat_name;
:
$wp_cats[$category_list->cat_ID] = $category_list->cat_ID;
and then change your <option> "ā tag:
<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>
:
<option value="<?php echo $option;?>" <?php if (get_settings( $value['id'] ) == $option) { echo 'selected="selected"'; } ?>><?php echo get_cat_name($option); ?></option>
I did not need to insert something into my .php header to make this work. So what does this mean, instead of using cat_name, it uses cat_ID, but fills in the user name cat_ in the drop-down list, but still associates each entry with cat_ID, which, I think, is what you were looking for. I apologize if this was a long, late or not quite what you were looking for, but this is my first contribution to the creation of the site, and it was this post that started me when I was looking for a solution.