Try:
$postintro2 = get_post_meta ($post->ID, 'postintro2', true);
if ( ! empty( $postintro2 ) ) {
echo '<div class="single2-intro">'.$postintro2.'</div>';
}
From the codex: get_post_meta
Related Posts:
- How to automatically apply woocommerce product title to all product images alt tags?
- Add custom field to attachments in a specific category
- How can update custom meta for all posts
- Passing the custom field values in the wp_get_current_user array function
- Firing schema via code in functions.php doesn’t work
- 3 Slashes appear after Apostrophe in custom fields after updating product-site
- Trying to retrieve post meta
- Which PHP page is the Default Posts Page
- How to check if a PHP string is different than meta field?
- Can’t save php string to a custom field
- Why does this update_post_meta function not delete the custom field itself?
- How to show/hide php table rows based on the content of custom fields
- Custom meta box values are not getting saved for my custom post type
- Show ACF field with link to ultimate member profile/WordPress user profile below the post (single post layout)
- WP All Import / Update stock quantity from multiple XML files
- Changing the order of custom fields in the dashboard for Woocommerce variable products [closed]
- How to add data to a custom field at the wp_users table?
- Problem with adding custom CSS class to image in ACF Photo Gallery plugin [closed]
- Hide a div when a custom field is empty
- Conditional On custom field plugin metabox
- Delete images from media library when user deletes an image from ACF Gallery
- Updating Metadata with Shortcode
- Products listing check if meta checkbox is checked
- Trying to update Woocommerce meta values
- Is it possible to update the dataset using update_post_meta
- Block error message in foreach loop when looping through ACF field
- How do I get the value of a current user’s custom field?
- Store custom field’s multiple values in one user meta key
- Get field in readable word
- Display custom meta box in my template file
- ACF Date fileds to Age Convert [closed]
- Appending an ACF custom field to the page title
- How to pass value to add_filter wpcf7_form_tag from another function?
- Custom Admin Menu Report for Specific User ID
- ACF number less than comparison not working
- Error Warning: Declaration of description_walker::start_el after PHP upgrade [duplicate]
- Displaying Logged-In User Name in WordPress Menu
- Autoloading in Child Theme
- How to add a class to the attachment images
- add_rewrite_rule with bottom priority doesn’t handle the WordPress pages
- Successful or Error Message after running mysql code in functions.php
- How can one utilize a variable as a callback function name for add_settings_field
- Count the number of times the search form template gets included on a page
- PHP code inside shortcodes
- Remove meta description on certain pages
- Image media upload metabox
- Store multiple custom field as post meta per post(css, js, html, 2 link) [closed]
- Woocommerce related product text
- esc_html_e() is not translating string in wordpress [closed]
- WordPress Gravatar filter is removing my custom attributes
- Incorrect amount of posts returned when filtering related Woo products by custom taxonomy
- Remove echo from shortcode
- Copyright info change – Corporate Plus Theme PHP [closed]
- Inject class in body when particular page template is used
- Echo a function inside a function
- Advanced Custom Fields – display label and value only if value entered
- How to list posts from a plugin taxonomy?
- wp_force_remove_style’ not found
- Pagination on Custom Post
- WordPress redirect redirecting too many times or not at all
- how to save checkbox data for custom setting?
- How to keep the capability of users and disable Gutenberg editor in WordPress?
- Enqueing External JS on the remote server JS
- Need to Modify a WordPress Shortcode with another wordpress shortcode
- How to add aria role and schema markup to custom walker container
- Adding custom url to readmore link using get_permalink()
- Remove submenu item from list
- Customize field names in backend profile edit page through function.php [duplicate]
- Insert content into head tag with function
- User filter posts by year
- bp-custom.php is not working on a WordPress multisite environment. how to fix it?
- Getting text from custom field from customizer
- Adding wp users ID into a link address from a DIVI modul
- Execute function only for specific user roles
- Limit Search to Product Pages only unless I’m on Blogpage or Blogposts
- WP query posts BUT show the most recent and one per author
- Include User ID in iFrame URL
- Run a sql (update) after 12 hours after the user login. Woocommerce users
- Wp_Schedule_Event every few minutes doesn’t work
- Best way to use variables in multiple functions?
- Can an AJAX callback function access a PHP variable which was defined during initial page load?
- Cannot fetch posts with certain ‘product_cat’. WP_Query is empty
- Detect what link user clicks and Redirect to a specific page for logged in users only
- Offset with ajax load more posts duplicates
- How fix error in the WordPress loop?
- Use WP_Query Data In Cookie
- Extend the WP_Customize_Image_Control class to change its non-frame $button_labels
- Function not pulling image or text from custom post type
- Sorting Meta Fields?
- syntax error unexpected ‘}’ at 364 line
- get_post_meta no longer working
- Highlight posts currently being edited on multiple editor site?
- Showing all post from all post type in admin backstage
- Pagination not displaying
- Setting WooCommerce currency programmatically
- Masking external links with internal link for member-only
- Shortcode to include PHP file, pass various parameters to include?
- Why can’t I include echo inside a variable? [closed]
- Assign new post author IF another user in custom field on post transition
- Create and publish a new post every Monday, listing the post titles and links to the posts published during the previous week