You could pull it directly form the database:
global $wpdb;
$random_photo = $wpdb->get_var("SELECT meta_value FROM wp_postmeta WHERE meta_key like 'single_photo' ORDER BY RAND()");
Related Posts:
- Query all posts where a meta key does not exist
- what is the correct way to compare dates in a WP query_posts meta_query
- Get post with multiple meta keys and value
- Echo all meta keys of a custom-post TYPE
- Post metadata deletes itself
- Custom Post Type: Set post_title equal to a custom post type field
- I can’t set meta_key in my custom post type query
- How can I include meta box content when searching?
- update a post meta from a single table cell TablePress
- Automatically adding meta data to posts or multiple query help
- Trigger “unsaved changes” dialog for custom post meta changes
- Conditionally Query Custom Post Types by Post Meta for Blog Home Page?
- Displaying custom posts only if custom meta box’s date is not expired
- Displaying Metabox value (custom post type taxonomy)
- How do I sort a custom post type admin column using two meta keys?
- How can I display my custom metaboxes on a custom post template?
- get_post_meta is returning image id
- Custom Post Type, Saving Multiple Checkboxes
- Create a random unique 6 digit number as custom field for custom post type
- Export entries and multiple custom field meta to .csv?
- how to interconnect custom post types?
- orderby in custom WP Query does not work
- Insert post metadata for all posts in CPT at once if metadata no existent
- Display custom post type from dynamic custom field
- Populate dropdown from one custom post type inside another custom post type
- Notice: Undefined index: error and understanding wordpress
- Custom Post Types. Are there any disadvantages/advantages in using a plugin to develop them?
- Get posts between custom dates
- Deleting Custom Posts & Meta Data on Uninstall
- How do I create an archive page as a including metadata?
- Two Custom Post Types Many to Many Relationship
- how can I register a post_meta field in an existing CPT and then call it again with get_post_custom()?
- post meta parameter in post custom-post-type endpoint with restapi
- Update postmeta Parent when post_status child change
- Update database from Quick Edit according to Checkbox state of Custom Post Type
- Custom fields (wp_post_meta) vs Custom Table for large amount of data
- Dynamic Custom Fields
- Show Custom Post Type meta boxes only on Page Edit
- Custom filter function not working with Custom post type
- Importing Data from a Non-WordPress database, into WP
- List Taxonomies: Don’t list taxonomy if it has no post – depending on custom post-meta?
- Can’t publish custom post type – “You are not allowed to edit this post.”
- Meta Data for Custom Post Type not saving
- Check if post with same meta value exists
- Filter date from post meta when date is in string format
- Do posts, pages and / or custom post type objects have unique ID numbers or can there be multiple objects with the same IDs?
- Archieve.php not loading for custom post type
- Get $post->ID from a URL
- Displaying a div from an assigned meta_value when on a page
- Create Array from custom post type to display a slider
- Values from meta-box not on $_POST
- Returning a custom content types with meta values
- Custom post type suddenly stoped working after WordPress 5 update
- copy images from custom field to another custom field
- How to show custom field on specific custom post type posts only when filled
- Cannot obtain custom meta information
- is_main_query() never called on WP 4.4
- How can I output WPAlchemy repeating fields meta values in my page template?
- Save Metabox Custom Field Value
- Meta box data not saving
- How can I get some of a posts meta data whilst it is still inserting?
- How to retrive Custom Post Type Meta Fields in Custom WP_Query
- Cannot Save MetaBox Data in Custom Post Type
- best way to use custom taxonomy, post type and meta in a job system
- Empty meta-box returns publishdate if no value is set?
- Say I have a tech blog, how best would I store technical specs for a phone, if i use custom post types
- Building tags and archive using meta from custom post type
- How to order custom posts by one of the custom fields value, ‘date’?
- Custom Meta Box with variable number of fields
- WordPress CPT Taxonomy Dashboard Search – How to include taxonomy in search?
- Custom Post Type meta data getting deleted on bulk editing taxonomies
- How to create review point system for CPTs (many-to-many relationship)
- After inserting new post with wp_insert_post() the post is not visble to WP_Query, but the same WP_Query works for post inserted from wp-admin panel
- How can I write a function that would update any missing specific post metadata?
- SELECT custom post type and its meta in SQL
- Custom attachment function not working in v5.4.2?
- How to return/export only data showing on screen in custom post type view all screen
- Use WP_query to match post types based on custom field values
- How to properly get the wp_postmeta.meta_value of a custom post type in specifics?
- Custom Function to redirect singular post if specific meta field is empty
- Stored meta from attachment, video length?
- Saving Child Terms on front end not setting parent
- Custom post type: “transition_post_status” action get title and other fields
- update a posts of other custom post type
- How do I extract the contents of a CPT’s custom field for all posts?
- How to get post meta for custom post type and taxonomy
- Delete custom post type metadata without deleting the post in admin area
- Order by post meta value gets random results
- How to create content automatically when a post is published?
- Rich Custom Field for Custom Post type not saving
- Add auto increment value to custom meta
- Return only custom post types for the page, not all
- Retrieve post data via WPDB class
- Create action running on trashed_post hook to modify post_meta value
- Post AND page parameter for WP function
- How to display Author Profile based on Custom field value
- Automatically add custom taxonomy when meta value gets to a set number or beyond
- Display a list of posts whose meta field values are equal to the ID of the post being viewed?
- Check for custom field value in different post type than current one and do something
- Post Meta for Custom Post Types