Definitely doable with tons of different ways to accomplish it. Basically, you can use a widget that allows for the execution of PHP or modify your theme files to execute PHP in the sidebar. The main function you will need is get_post_meta
. You also need to access the post/page/CPT ID. You can use code like the following to get your post meta displayed.
global $wp_query;
if(is_object($wp_query->queried_object) && $wp_query->queried_object->ID)
{
echo get_post_meta($wp_query->queried_object->ID, 'my_post_meta_key', true);
}
Obviously, you need to change the “my_post_meta_key” value to a key that corresponds to the meta data that you want. Also, there are other ways to access the current page/post/CPT ID, but since I do not know your specific context, this will work for most situations.
Related Posts:
- Individual Widgets per Page
- Having different sidebar content for MANY pages?
- Is there a way to dump all registered sidebar/widget?
- Add class from custom field into widget class
- Custom Post Type Data in Sidebar widgets?
- Custom per-page sidebar widgets .. possible?
- Add multiple images to a page sidebar
- Best way to allow manageable social media URLS?
- How do you create dynamic customised sections in WordPress?
- Creating a custom menu/widget area
- Creating a widget with a number of custom fields
- Random image from tag/custom type on sidebar
- How to display image inside container of custom made widget
- Want to make A CSS if meta key value is empty
- how to display a widget only on a page where the custom field is defined?
- How Do I Display A Custom Field In The Sidebar Of All My Pages?
- What’s the best way to implement custom widgets on a per post basis?
- Display custom widget value in header.php
- Add custom data (field) to sidebar widgets for later display
- Custom field outside the loop and inside an array
- custom filed from post in the side bar
- WP_query returns error when used for custom widget
- Running a Gallery Shortcode in a Custom Fields Widget
- What method should I use for a sidebar widget that reads latest posts?
- I would like to display different text on different pages
- How to check if custom field exists in this widget query
- Add fields to edit in custom widget
- WP_Query – Order results by meta value
- Custom query with orderby meta_value of custom field
- How to enable revisions for post meta data?
- Including custom fields in search?
- Sort posts by custom field numeric value using dropdown
- How to position a custom field before the editor
- How can I display all values of a custom field from posts with a certain value of another custom field or from certain post types?
- Retrieve custom fields on Categories, using WP-API
- Order by custom field date?
- can you set a default value to a custom field
- use get_posts to get custom field data, but in one array
- automatically set “Featured Image” the same as the og:i that is set in a custom field
- Display value of custom field not working
- WP_query : meta_key with custom rule for specific value
- Removing custom widget area WordPress 4.4 [closed]
- How to get the db table row that has the biggest value in the meta value?
- making sense of admin-ajax
- Add url from Custom Field as ‘Featured Image’. Code not working
- Missing argument 3 for wp_register_sidebar_widget()
- How to update a meta field of type array in Gutenberg
- Bulk remove post meta
- Widgets not activated alert after using get_sidebar()
- Storing a DateTime Value in a Sortable Custom Field?
- WordPress Rest API to call page data associate with custom meta
- Trying to create dynamic widget area using post ID
- How to show a post if was published less than two hours ago?
- Custom field as Slug
- How to save the date/time of last update of an extra user profile field?
- How to populate custom field dropdown box based on prior selection?
- Define a post’s title and slug from Custom Fields
- How can you include custom post meta in search without calling each key?
- Custom wysiwyg editor doesn’t execute shortcodes?
- How to hide a div based on contents of custom field
- Hook after meta created
- How to determine if the sidebar is empty? Or not active?
- Where does this field get its value?
- Get all the posts where meta field with multiple choice has several values checked
- Warn user that data may be lost for custom pages
- Can’t query by meta_key
- Display MP3 as media using an URL from a custom field
- Print Posts if Custom Field Value Date equal or greater than Today Date
- Update post meta custom field using block editor
- If I update WordPress my custom data will be deleted from the wp_users table?
- Get emails from users by custom field SQL
- My widget not printing before_widgets and after widgets
- Convert all dates stored in custom field
- Why am I getting a “Call to member function format() on a non-object” error?
- HM CMB: Role Select
- Custom Query Fields – Altering Meta Value
- Adding re-type email and check it if the email match
- show a specific metabox dependent on the page template
- excluding posts by an ACF field in pagination
- Search & column order by meta value in admin
- Exclude URL’s from sanitize_html_classes
- Best way to insert a list of links into a post outside of the_content
- Need to delete the sidebar widget area and have the page a full page rather than just have a blank widget area
- How to add a post’s view count into the WordPress API response
- How can I ‘check’ the “custom fields” box from the Screen Options?
- How to get all wp_posts in wordpress fetched from database
- automatically add custom fields to post title
- Custom Fields Permalink Plugin not observing hyphens
- will wp_insert_post write a new custom field to the database?
- How to repeate custom field group with bulk image field
- Extra text’n’image field in a page
- Get first URL from custom field, download and set as featured image on post publish
- How to add an option to admin to add image that could be used as header?
- How to query posts that have certain post meta keys, and sort by meta key and/or value
- How to hide sidebar widgets in all pages except Hompage?
- Add image custom attribute [closed]
- Foreach giving one too many list items, how can I remove the last empty line?
- Add custom fields to specific menus
- Multiple triggers when publishing, saving or updating a post in WordPress
- If possible a field ID transfom in a Custom Field?