In answer to my question (and in case anyone is interested), this seems to be the best solution:
<?php
$service_name = $post->_cmb2_service_name;
?>
<p><?php echo $service_name; ?></p>
Related Posts:
- How to sanitize select box values in post meta?
- Strategy to get post meta for use outside the loop
- Set Expiration Date of a Post from the Frontend with wp_insert_post
- Is there a need for nonce with Post Metabox?
- Metadata Query when storing data as array possible?
- Wp Super Cache stops the update of a Post Meta
- How to show specific post meta?
- Running a function on post update with new post meta
- Get attachment meta (I need attachment ID, unsure how to find it)
- How can I sort my loop based on meta data, using a form?
- Related Post Category Filter
- Make a custom field in admin post.php read only
- Change default options on attachment page
- After a while attachment meta data is missing “sizes” data
- Why is my Toggle field not showing in Gutenberg?
- Software for WordPress Theme and Plugin Development? [closed]
- How to override pluggable function in theme?
- Should we use get_template_part() in functions files instead of include_once?
- Reset positions of metaboxes in admin
- Remove the word ‘Categories’ from wp_list_categories
- Using Bootstrap in themes
- Add a dropdown to theme customizer
- design and development workflow
- How to control initial wp_head() output?
- enqueue script for specific shortcode
- Any walker causes blank menu?
- How to change post thumbnail title and alt attributes to post title?
- Why might $input (Settings API) be coming through empty?
- add generated stylesheet from parent theme after child-themes style.css
- Creating Page Based on Category
- How to check if post has any tag?
- using wp_enqueue_script to attach jquery-ui
- Merging PHP download script into `functions.php`
- Should use widgets in this case?
- Can not Remove Archives and Meta from Sidebar
- Get last modified date for menu link
- Similar Posts – NO plugin
- How to add multiple custom widget areas
- A theme that follows all the best practices to learn from?
- WordPress how to override function adjacent_posts_rel_link_wp_head() in link-template.php the correct way
- Can wordpress run in root of existing php site with no theme on index.php but all other WP posts/pages?
- Change file name from wp_generate_attachment_metadata
- Change setting name in Customizer and keep the data
- CSS won’t style output of wp_nav_menu() correctly
- Obtain full v2 REST url?
- Creating multiple hooks for theme
- after_setup_theme, Global Variable and Theme Customizer
- Show warning if plugin is missing
- How to make WP admin recognize a newly created child theme?
- Can’t show custom post thumbnail sizes as background images
- How to provide support for [gallery] shortcode?
- WP_Customize_Color_Control omitting # symbol
- Theme translation not applying
- How to add filter the post thumbnail before save in database?
- Custom theme development additional pages
- How to add material design css in wordpress and woocommerce
- How to set the currently active page in the menu including parents
- changing blog title to an image using filter function in child theme
- What is the safe way to print tracking code / pixel code before tag or tag
- WordPress taxonomy and archive custom class
- Acivate all themes multisite wide automatically
- What is the meaning of WordPress’s recommended css classes and where are they applied?
- Would to use AJAX to get an option from the database and use it in a jquery setup or is there an alternative to consider?
- Website pagespeed problem
- Theme support title tag – how to replace the default WP separator (with a filter)?
- Why are some of my menu items not displaying on my menu?
- Managing WordPress Theme
- ajax response -1 in wordpress theme
- next_posts_link and previous_posts_link problem
- How to change footer credit text in Twenty Twenty One theme with a hook?
- Gutenberg theme development: how to add “headers” option under styles > colors > elements?
- How to override template files in parent theme?
- How can i make multilevel menu in wordpress theme with bootstrap
- Output richtext metabox value
- Twenty Twelve Author not displaying
- Read more doesnt work with query posts
- Default PHP document / names needed for a WordPress theme?
- Dynamic Image Links Depending on Excerpt/’Single Post’ View
- Custom fields for custom post types
- What is the_permalink() on a category page?
- How to modify theme content in Thematic?
- Sidebar not displaying (theme development)
- WordPress theme options checkbox default checked state
- Custom themes that won’t work when theme is changed
- WordPress Theme: What is the right way to put inline CSS loading from a CSS file
- Cold Fusion to WordPress
- How do I build a WordPress Profile/Author Header?
- Create settings field on button click
- get_posts is duplicating
- How to remove menu from WP-Admin menu
- apply_filters to featured image
- How do I move menu to the bottom in Custom Community theme?
- How do I get information about a page, such as featured image, except, and title?
- WordPress Loop with Custom Post Type for Bootstrap Accordion [closed]
- How do I make it super customisable?
- Theme.json: creating different sections of the color palette
- How to send async emails in wordpress?
- ways to create customized theme (hard coded – no pagebuilder)
- Can’t select my block by clicking on it on apiVersion – but using blockProps
- Webpack does not create or update index.asset.php file in build folder