This is really just a PHP question, but since there is no Core function to do this…
I’d use !empty()
. Otherwise just echo
a string.
$mcontent = get_post_meta($post->ID, "vw_citation_title", true);
if(!empty($mcontent)) {
echo '<meta name = "citation_title" content = "''.$mcontent.'" >';
}
Related Posts:
- Make Custom Metaboxes Collapse by Default
- Check for and enforce unique value in user-entered custom meta field in WP Admin
- Add ‘Right Now’ widget to custom dashboard
- The Best Way to always load the newest version of 3rd party code
- I’m using add_meta_box() but want to include TinyMCE editor *and* Media Uploads for each box
- custom meta box for page default template
- Data won’t save if metabox within conditional in admin. What am I missing?
- Let author add field to metabox by pressing a button
- Showing Meta Box via Jquery Checkbox
- problem saving/ retrieving custom meta with wp alchemy metabox
- WordPress 3.1.2 Bug: add_theme_support() and video post format registering twice
- Select input in metabox not updated
- Multiple header style under meta box
- Adding a drop-down (select tag) option under Menu Settings in WordPress Admin
- Change meta-box title- “LearnDash Quiz Settings” to “Quiz Settings”
- Embedded Options in a Custom Metabox
- duplicate featured image functionality in custom meta box
- How to add custom Author Info Box to blog posts “only” and NOT custom post templates
- issue with saving custom metaboxes fields
- after checked the checkbox in backend, dont show social link on frontend
- Change post template the proper way
- Get a different size of Image thumbnail while working with custom metabox
- Need Advice to Working with Custom Post Meta
- Is there anything that Joomla or Drupal can do that can’t be done in WordPress? [closed]
- Custom maintenance page
- Removing Metabox for “Slug” without removing functionality
- How to customize the default HTML for WordPress Attachments
- Customizing the Subject Field in WordPress’ Notification Emails?
- How to move wp-content (or uploads) outside of the WordPress directory
- How can I integrate pages written in something other than PHP?
- Maintaining synced staging/production WP sites
- WordPress Multi Site Best Practice
- Custom field values in permalink
- Redirect to requested page after (custom) login
- Problem in custom meta boxes
- Custom protected password page with ACF
- Page load requires a trailing “/” [closed]
- Custom Dashboard Home Screen Options
- dynamic external javascript generated using php
- Show Custom Taxonomy Slug(s)?
- What’s the proper way to use a custom table? [closed]
- How to retrieve the value stored in a multi-dimensional array and SUM the entries?
- How can a single line in a blog post take down my server?
- Adding a Table to the wordpress database
- Integrate WordPress into existing website
- How can I use get_bloginfo(‘admin_email’) in a custom PHP file?
- how can I change the background color of all posts on my server?
- Turn off redirect to canonical domain (or host website on any hostname)
- CSS to remove “comments count” icon from main page [closed]
- What’s wrong with Customizing new user notification email by add_filter?
- Automatically Update Woocommerce Prices [closed]
- Multiple Tinymce/wp_editor in WordPress >4.8
- How to provide a demonstration of WordPress for new customers
- CPT Loop with ACF and passing ID between Loops
- Showcase elementor templates
- Add clickable arrows to parent menu items with children elements e.g. with
- Woocomerce custom billing address fields display in order details [closed]
- No shipping method has been selected [closed]
- How can I setup up an a pre-populated pdf based on what was entered? [closed]
- Get rid of title from static front page
- Organizing the position of widgetized areas in the backend
- Why the css in twenteenfourteen-child theme take no effect?
- Is there a way to create a meta box that can be added multiple times to a post dynamically?
- Get wordpress taxonomy slug name(s) to use as div class
- Why does my Posts page only show a single post when using Thematic?
- Specific colours for wordpress author ids
- add custom content to appearance/widgets screen
- css media query question [closed]
- How to create a page /1 using ?
- Open “Visit site” in a new window?
- Separate header for static home page and posts page
- Pagination with custom field
- Where to upload my new custom ShortCode in Separate .php file?
- wp_insert_post custom taxonomy multiple Category not added
- Get custom text if in Category
- Conditional Logic on CF7 dropdown options
- Change admin_title of a plugin using code snippet/functions
- Can’t upload format files on media library
- Adding a custom field to a slug
- How to show Term ID beside Name Category with wp_dropdown_categories()
- How to create custom backend admin menu in different languages?
- WordPress Performance and bulk edits
- Delete page titles
- Send email notification when post type product is publish from pending status
- WordPress Customizer: Check for value of CSS selector and replace it
- data retrieval presents last set of data
- Bio comes up when the visitor clicks on a picture
- Accountless password generation
- Creating a Treeview Listing of a Directory
- WooCommerce – Adding custom HTML to specific product pages
- How do I move my sites to a child theme without loosing customisation?
- How to create new page can get custom field other post in wordpress
- insert autofocus in a custom taxonomy form
- display my pages html
- customize footer widgets area
- Accessing + retrieving custom database in WordPress
- updated permalink structure on localhost does not work
- Word Press Theme Customiser and Child theme Function.php
- Security Issues with custom user role or changing core role capabilities?
- adding new html css to wordpress section from codepen [closed]