Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

Thanks

share|improve this question

1 Answer 1

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

http://wordpress.org/extend/plugins/custom-options-plus/

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

 
discard

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.