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

Part of a function i'm using in my single.php page is

$myposts = get_posts(array('numberposts' => 10, 'offset' => 0,'post_status'=>'publish','category' => 32));

I need to make the number 32 dynamic so it can be set from the dashboard

I'm familiar with advanced custom fields for posts. Is there a similar plugin that would let me create custom options? Or can someone suggest a good modern tutorial on creating a basic option like this in the dashboard


share|improve this question

I found this plugin that let me create custom options and set the value dynamically in my templates. Worked out fine


share|improve this answer
IMHO not really useful to set categories ID, once you migrate all the IDs wil change, it will be sorted out.You can try pass the category name and use get_term_by(). – Diana Jul 28 '12 at 22:35
Well that's my reason for making it dynamic so that on a new server it can be set dynamically from the dashboard. – Anagio Jul 28 '12 at 22:38

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.