You must pass the $post->ID to the function or setting up the current post via a call to
$specialPosts->the_post() that fills it for you
See get_post_custom_values documentation in the codex or this page on how to use it.
Try
<?php
$specialPosts = new WP_Query();
$specialPosts->query('pagename=page-'.$i.'');
while($specialPosts->have_posts()): $specialPosts->the_post();
$mykey_values = get_post_custom_values('custom_select');
foreach ( $mykey_values as $key => $value ) {
...
endwhile;
Related Posts:
- Where are custom field values stored in the database
- Custom post meta field effect on the performance on the post
- Using TinyMce with textareas in meta boxes on custom post types
- Having different sidebar content for MANY pages?
- How can I fetch CSS from JSON WP REST API response
- How to set a default meta value for custom field
- Create meta boxes that don’t show in custom fields
- How To Create a Metabox of HTML Content with Instructions For Editors When Editing a Post or Page?
- Plugins won’t recognize my plugin’s hidden custom fields
- wp_editor in add_meta_boxes does not show gallery
- Calling Specific Pages with wp query Part II
- How do I assign this filter to a variable? (Appending php & markup to the_content)
- If value present, order posts by two consecutive custom fields
- Copying Custom Meta Values from existing post to a duplicate post
- Save page data to an xml file
- Displaying posts with only upcoming dates according their custom field date value
- How to filter a dd/mm/yyyy date from a custom field in a query
- List posts with common custom field value
- Create Posts using Import>RSS/WXR/XML and pass values to Custom Fields
- Importing users to Buddypress with custom fields
- How to save a ToggleControl value in a meta field?
- Is it bad to use a lot of Custom Meta Fields?
- How to get customfield value by woocommerce product ID
- How do I get the url slug inside the dashboard for a custom post type?
- How do I use Ajax to build a dropdown of custom fields based on a post selected in previous dropdown?
- Register rest field for specific user
- Audio player shortcode not showing up when using variable
- Save the_content into custom field
- how to upload a image from frontend with wp_insert_post and also update_post_meta?
- Get updated meta value after post update or published (custom post type) using hook
- Custom dropdown field added to media gallery; how to get it to save properly?
- Insert a custom field into a shortcode and use it in post(s)
- Sort alphabetically by custom field
- Uploading PDF using Media Uploader
- Why orderbyb meta_value_num won’t affect the generated SQL Query order?
- Sorting editor screen items
- get post id using custom filed value
- $TBA Getting Translated to $0 (Custom Fields)
- How Do I Display A Custom Field In The Sidebar Of All My Pages?
- Query_posts with custom field meta value
- Passing meta_box string to post__in?
- Can data from a Custom Field data be used by a shortcode on a per page/post basis?
- How can I modify RSS item titles to be either the title or a custom meta field?
- Custom Field – Do Not Show if Value is Empty?
- Move Title and the Content WYSIWYG editor position
- WordPress built in custom fields don’t validate or sanitize? Is there a way to fix this?
- wp custom field date format compare
- frontend submit post jQuery clone row won’t save
- WordPress colorpicker save both hex and RGB
- Can’t get video meta from wp_read_video_metadata()
- Best way to contruct a global custom field?
- Include one custom field in search results
- Custom search SQL Query to add custom field in result
- How to write specific HTML code with a specific custom field? [closed]
- How to style posts selecting a CSS post_class (added through custom_fields?)?
- Can wp_insert_post_data filter be used to save custom field data?
- Meta query relation ‘OR’ not working as expected
- How to hide custom fields added by a plugin?
- Custom field Search with Relavanssi
- How to exclude custom fields from search queries?
- Add Custom Fields After Page Title
- Footnotes in custom fields
- Image upload and path to custom field
- Create a new custom field for all posts based on current custom field
- Custom fields won’t update
- Using Custom Fields to Trigger Specific Actions on Saving a Post?
- How to use custom fields like Title to show value in content?
- Populate custom checkout fields with data from previous orders
- User query – getting values for custom meta keys/fields
- Expire Date Condition not Working ACF WordPress
- Making custom meta box required (with error message if not filled in) on Gutenberg
- Changing form action based on selected value
- trying to add extra field using hooks
- Can’t set custom meta fields for a post
- Hiding Dropdown Fields
- Custom fields with wordpress
- what would be a good example of a php dynamic code to display contents of textarea?
- How to add content with a filter when there’s no content in the editor
- Get file size from ACF repeater field
- Append custom field items to content from plugin
- Text in header as a page – hide from Web crawlers
- When post is updated, custom metadata in text area field is overwritten
- Set Value To Custom Field While Submit
- Show or hide lang=”ur” in main element
- How to use a custom field for search engine optimization
- Fetch data from a WP page with same name as current username
- Getting content from custom fields of different pages on a single page
- Custom Fields – How can I remove the publish option for certain users
- Can i categorise my meta box?
- How to overwrite a value for a custom field?
- WordPress archives by custom field and date
- When editing a post with a custom meta box the values aren’t displaying correctly
- Function to retrieve a picture if there is no picture is attached
- Show posts containing or not custom field
- How to get the value of particular get $meta value in wordpress
- custom field as a boolean with a checkbox?
- add_post_meta insert null value into Database
- Website that sells statistics
- Extract array from custom field
- extra post fields for url + youtube video / implementation