WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This code is in my functions.php:

array( "name" => "Headline",
"type" => "section"),
array( "type" => "open"),

array( "name" => "Headline  Categories",
"desc" => "Choose a category from which featured posts are drawn",
"id" => $shortname."_headline",
"type" => "select",
"options" => $wp_getcat,
"std" => "Select a category"),

array( "type" => "close"),

Now, how to show posts from category select on page.php or page template?

share|improve this question
This code is incomplete. What you have posted doesn't actually do anything. – s_ha_dum Jan 28 '14 at 5:19
i read on this www.colorlabsproject.com/tutorials/create-a-simple-wordpress-admin-panel-part-ii‌​/ but i don't know how to emplementation on frontend, can you help me? – aank Jan 28 '14 at 5:38
what i mean before is, how to show all post in select category by panel themes, and now its work.thanks – aank Feb 7 '14 at 10:05
But what is your solution? So that other people can benefit? – s_ha_dum Feb 7 '14 at 13:22

It looks like you are trying to model this on theme options code. You can't do that. That is backend code. As written, this question is very broad-- I am tempted to vote to close as "too broad"-- but I will offer bare bones code to get you started:

echo '<form method="post">';
  echo '<input type="submit" name="catsearch" value="Submit" />';
echo '</form>';
if (isset($_GET['cat']) && ctype_digit($_GET['cat'])) {
  $qry = new WP_Query( 
      'cat' => (int)$_GET['cat'] 

You will need to consult the documentation for wp_dropdown_categories and WP_Query, and will probably need to do a bit a research on HTML forms and basic PHP.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.