Found an answer to my question using the ACF plugin get_field function (http://www.advancedcustomfields.com/resources/functions/get_field/) to retrieve the value of the custom field, save it as a variable and then use it as part of the query_post parameters:
<!-- Modify query object -->
<?php
$num_news = get_field("number_news", 523); // number of news items to feature
query_posts('showposts=".$num_news."&post_type=news');
?>
... rest of the code ...
Related Posts:
- ACF: post query, hide duplicate values [closed]
- Unable to check if plugin is active
- How to get current post ID in Contact Form 7 wpcf7_before_send_mail hook action
- WP_query parameters for date range
- Using Advanced Custom Fields with WordPress and Lightbox
- How to store ACF custom fields data in a custom table
- Generate Advanced Custom Fields box in custom admin menu page
- Edit Imported advanced Custom Fields from wordpress Dashboard
- Visual Composer vs. Advanced Custom Fields [closed]
- ACF for audio url in wordpress audio shortcode
- Custom field in TWIG template – Advanced custom fields plugin
- Advanced Custom Fields query
- How do I add advanced custom fields / meta fields to Elasticsearch? [closed]
- Loop with array of posts using ‘Advanced Custom Fields’ plugin [closed]
- Using ACF to display data on all pages
- greatest() function returns undefined property
- Advanced Custom Fields/User Role Editor – how to hide ACF for certain users?
- Last modified field for user profile?
- WP_Query ordering numbers as letters
- Get post by ASC from custome field DATE picker
- Getting value from Advanced Custom Fields [closed]
- How can you include a theme template file from within a plugin (i.e. WooCommerce’s Shop page)?
- Inserting HTML tag with ACF into shortcode
- Advanced Custom Fields plugin – get text from editor field and save it in a variable
- Call to a member function have_posts() on a non-object on normal loop
- Pull out Advanced Custom Fields in Related post plugin
- Multiple instances of nivo slider plugin
- Using a post-signup hook to get user details
- Matching Chapters to a Custom posts [closed]
- Advanced Custom Fields displaying on tag pages
- Custom Fields with Pods not being translated
- is there a way to link one of the field in ACF field group, to a field in a media attachment page? [closed]
- How to remove the inline styles from the content of a WYSIWYG editor field at the time of saving the post?
- add custom filters to the event calendar plugin programatically to frontend [closed]
- Can you use another Profile Builder shortcodes through advanced custom fields
- dirname( __FILE__) returning wrong directory inside plugin
- background images WP Supersized on homepage
- Redirect to another page using contact form 7? [closed]
- Paid Membership Pro with ACF [closed]
- ACF only showing up in Homepage but doesn’t appears in all pages
- Advanced Custom Fields – Disable Users to Edit Custom Fields
- URLs Added to ACF Repeater Field are not working
- Advanced Custom Fields – Get value in other plugin file [closed]
- Render content of multiple pages and their descendants
- order posts by `meta_key`, Does not display posts that does not have `meta_key`
- Slashes stripped in ACF
- Remove Advanced Custom Fields plugin for client?
- Adding class to last list item? Not WP generated
- Keeping and updating ACF and ACF Pro at the same time
- How do we update a custom file upload field with the Advanced Custom Field plugin?
- Advanced Custom Fields (acf) – Filter Relationship by Taxonomies not Post Type
- Conditional custom redirect
- Preview with Custom Post Type Not Working
- How to get the get the select values created by ACF plugin in wordpress
- Advanced custom fields and Slideshow gallery desn’t work together? [closed]
- Advanced Custom Fields Plugin – Images not displaying
- How to create repeater field manually, without plugin (ACF Pro)?
- How to validate custom fields in Quick edit/bulk edit?
- What snippet do I need to type to show my ACF field show up on my theme?
- Setting Author on CPT
- Can’t load the the canges of field groups [duplicate]
- Multisite – Cloning CPT pages + content (including ACF Flexible Content) from site to site
- ACF checkbox return format based on page
- custom fields not displaying on wordpress site
- custom post type get_posts() function not work
- ACF Fields are not showing up on Homepage
- Why Custom fields description is not working WordPress Version 5.4.2?
- Images are broken in Wysiwyg Editor – ACF backend
- make p tag collapsed after 3 rows
- Performance considerations – postmeta table versus new table for custom posts with foreign keys?
- Change the color of ACF Subtitle output background
- Add Custom Field to Post Pages via Plugin
- Returning incorrect $post->ID after installing plugin
- ACF Query result in a new td (echo)
- Get only selected custom taxonomy
- ACF Taxonomy search on backend (Relationship field)
- Else If statement for ACF [closed]
- plugin_dir_url(__FILE__) searches parent theme in ACF extension
- how to repeat taxonomy in different places on wordpress
- Show all posts of all categories but excluding a category on custom blog page with pagination of my theme
- How to use categories in the URL with Advanced Custom Fields?
- get post excerpt by query
- Advanced Custom Field User Help URL
- WP-Snap too slow (caused by WP_Query?)
- Define constant for one plugin in mu-plugin
- single.php fires more than once after clicking on any post to view with different post id each time
- WordPress plugin not eching popular posts
- Hide/Show panel not showing – ACF
- Pulling Advanced Custom Fields from other pages
- ACF: Hide a div or template section when a custom field (in a field group) is empty
- Custom time field won’t sort regardless of format
- How ACF Advanced Custom Field works with Woocommerce Single Product [closed]
- ACF Taxonomy Object term Null [closed]
- Browser Cache causes ‘Orderby=rand’ to return the same posts
- ‘Active lotteries’ only custom query for woocommerce lottery plugin and elementor
- Update acf field in woocommerce orders
- True/False ACF field returning null by default even if default value is true
- Sort posts by Date (DESC) and by ACF: active_inactive (ASC)
- ACF prugin for WooCommerce Shop Page
- Using ACF to allow user to add and edit multiple saved forms