I don’t know exactly how that plugin works, and you have posted code that is probably missing context but you need to define $post_meta_data
before running line:
$custom_image = $post_meta_data['image'][0];
It seems that the plugin is using post meta so you should need something like this:
<?php echo get_post_meta($post->ID, $prefix.'hjemmeside', true); ?>
But rewritten to save the data as a variable instead of echo
it. Guessing based on the code you posted, I believe you need:
$post_meta_data = get_post_meta($post->ID, $prefix.'image', true);
if (!empty($post_meta_data[0])) {
$custom_image = wp_get_attachment_image($post_meta_data[0], 'thumbnail');
}
echo $custom_image; // if desired
Untested, but stands a good chance of working.
Related Posts:
- Detect meta value changes when post is updated (post_updated)
- Formatting custom meta box date from YYYY/MM/DD to a more readable alternative
- Populate Custom Fields in a Custom Post Type?
- How to check if user meta field is empty in conditional else statement
- A better way to add a meta box to custom post types
- create custom meta box with default value
- How to show custom field on specific custom post type posts only when filled
- How can I output WPAlchemy repeating fields meta values in my page template?
- Add a class to post_class if more than one post shares same meta_value_num
- Add a meta field to the list of results for a custom post type
- Empty meta-box returns publishdate if no value is set?
- Custom Post Type meta data getting deleted on bulk editing taxonomies
- Delete custom post type metadata without deleting the post in admin area
- Visual editor issue by having multiple tiny mce editors in a CPT
- Update Post Meta for a logged in user
- Found 2 elements with non-unique id (#_ajax_nonce) and (#_wpnonce)
- Plugin – Combine Meta Box Input Fields into single saveble record
- Two Custom Post Types Many to Many Relationship
- get_post_meta not working on publishing
- Meta Query Filtering not working on Custom Meta Box using Radio Buttons
- How do I set all of a particular post meta to a value within the custom post type I’m in?
- Grouping metadatas into one
- Metabox not show in categories custom post type cmb2
- Repeatable Fields Metabox with Textarea (or wp_editor)
- How to use TinyMCE Editor for one of my custom post meta field?
- Custom fields (wp_post_meta) vs Custom Table for large amount of data
- Show Custom Post Type meta boxes only on Page Edit
- Cannot save CPT meta box
- Adding Page Templates to post but it ignored it
- Importing Data from a Non-WordPress database, into WP
- Permalinks: custom structure for taxonomy – tags?
- Can’t publish custom post type – “You are not allowed to edit this post.”
- Custom fields for custom post type
- Custom “radio button meta box” not saving correctly
- Meta Data for Custom Post Type not saving
- Add additional field to custom post_type
- Custom Post Meta from custom metaboxes is randomly being deleted
- Check if post with same meta value exists
- Add a custom meta box for client to order CPT posts how they want
- Submitting Custom Post Types with custom fields from Front-end form
- Display Repeatable Meta Box Content
- Displaying a div from an assigned meta_value when on a page
- List of users that clicked a ‘Join’ button at single post
- How to Echo Metadata Value in Currency Format
- Issue on Working with Metabox – Checkbox to enable Sale Items
- delete_post_meta() for whole CPT / multiple posts?
- How to get specific post meta by title or id
- What do the numbers mean at the end of add_action(‘save_post’)…?
- A meta box (in a custom post type) with two different type of fields
- Why do I have to press the “Update” button twice to save my meta box values?
- Inserting custom fields into single.php
- hide specific div on single.php [closed]
- Values from meta-box not on $_POST
- Custom post type suddenly stoped working after WordPress 5 update
- copy images from custom field to another custom field
- Reusable metabox backend and frontend
- Cannot obtain custom meta information
- Get custom term meta problem on single post type
- Display custom meta on page that has been check in custom post type
- Meta box data is saved but NOT displayed in the meta box text field. Why?
- How to call a post’s metadata in shortcode.php?
- How can I modify a custom post type and custom page template for a child theme if all content seams to be handled by theme’s ‘native’ plugin?
- Save Metabox Custom Field Value
- Meta box data not saving
- WP_Meta_Query object with conditionals
- Related posts meta_query CPT
- Meta box with front-end styling
- Sanitaizing Select Optin For Custom Post Type Metabox in WP
- How to retrive Custom Post Type Meta Fields in Custom WP_Query
- Cannot Save MetaBox Data in Custom Post Type
- Adding an extra parameter [string] to my posts’ permalink?
- delete duplicate meta_value with same post_id
- Search CPT Title AND Meta
- updating one custom meta field only
- Problem On Retrieving Post Meta Data on Custom Column [closed]
- Function to return values from metabox
- Saving metabox keys and storing values as array
- Custom Post Type Meta Box Text Input Field Won’t Save When Blank
- Filter search posts by post meta?
- Custom Meta Box with variable number of fields
- Custom fields for post or terms which don’t update on post update
- Unable to gather Image URL from Custom Post Type’s; Custom Meta Field
- How to keep custom post type related information
- How to avoid duplicate posts queried from custom meta?
- Custom Metabox Info Not Saving
- How can I add a meta[] to my custom post type and search by term with the Rest API?
- Show posts from WP Custom Post Type selected from a field in a metabox
- Creating an archive page or simple template to list all values of a custom field of specific post type listing
- Where is get_post_meta value located?
- PHP Warning with Custom Fields
- Custom meta fields not showing up in WP_Response Object via custom endpoint
- Problem with multi checkboxes value in metabox?
- Get meta values from parent post and save in child post
- How to Disable option of meta field if that option is selected for any other post in custom post type?
- Simple Data picker meta box
- Metaboxes in Loop
- Add more custom fields when creating a new custom post type
- check_admin_referer not working in custom meta box for custom post type
- Custom meta box data not saving
- How do I extract the contents of a CPT’s custom field for all posts?