This is very basic. Invest some time in a PHP tutorial. It’s fun! 🙂
Anyway …
<?php
$meta = get_post_meta( get_the_ID(), 'rw_agentPhone', TRUE );
// get_post_meta() returns an empty string if it doesn’t find anything.
// We just test for this. If the string is not empty, we print it out.
'' != $meta and print "office: $meta";
?>
Related Posts:
- Conditional Statement – check if post has an attachment image
- Trying to use Ternary operators with WP Conditionals
- How to do conditional publishing?
- conditional statement for custom taxonomy
- Add user settings to specific roles
- How to display conditional-content if wp_nav_menu( $args ) retruns something
- Create a new usermeta field for users
- Redirect to a different page through registration, depending on page
- How to Arrange PHP Files to Allow for Multiple Types of Pages?
- What is the correct way to write this conditional statement?
- Reordering Buddy Press profile navigation [closed]
- Is_front_page inside header.php is always returning true
- Advanced Custom Fields – display label and value only if value entered
- PHP conditional script issue
- How to check if the current page is at a specified path in the URL?
- Add class to DIV depending on page loaded
- Can I set up a hover animation in CSS depending on a PHP conditional?
- Multidimensional Array
- Conditional featured image with youtube thumbnail
- How to make a conditional statement within $output in shortcodes.php?
- Conditionally remove comments and post meta in functions.php
- exclude custom post type from running a function
- include content within conditional statement?
- Conditional formatting on data fetched from MYSQL
- Find and print first entry from WordPress post in custom excerpt?
- Adding if statement
- Change Login or Logout text based on status
- Jetpack: Display Site Title when no Site Logo
- If else statement based on referral URL
- If Month=Particular month display content [closed]
- Php conditional help needed
- Custom Meta Box If Else Statement
- Hide a nav menu item based on get_user_meta results
- How do I reformat this to add php inside php?
- Not able to see the error [closed]
- How do I make a redirect in PHP?
- Include files in functions.php
- Display all meta for a post?
- How to include external page to wordpress page?
- How to overwrite youtube embed?
- How to resize image on client-side before upload?
- How to show order data by multiple ID?
- Print html when custom field has value inside while loop
- how to create and show sessions in word press?
- Foreach insert query the best way
- Stop Duplicating Terms in a Foreach Loop
- Generating add_settings_section() calls dynamically
- Loading jQuery in the footer after removing jQuery migrate?
- “before delete post” action fire when the post is updated?
- Register non hierarchical taxonomy and the show meta box in the post type
- Admin username and password
- WordPress excerpt not working
- Random Default Avatar Function
- Redirect to another page after submission using wp_mail
- Loop with slider (slider not loading)
- Error when adding excerpt to the content through functions.php
- wordpress media library new uploads don’t write to database
- Add data attribute to each li in menu
- How to bypass maintenance mode with external cron?
- PHP > Scheduled Tasks > Sending daily email with dynamic API variables
- Echo possibly causing custom template formatting conflict
- “Undefined index” error when saving empty array with checkboxes
- WordPress comment submit button substitutes/options
- How to make container class in PHP
- Conditional using get_the_ID() not working [closed]
- How to fix this PHP warning in WP-Admin after upgrading to 3.1.2?
- PHP Notice: Undefined offset: -1 – Navigation Previous/Next
- Where is the PHP code generating an element?
- How do I check or test a WordPress Auto Year Change Script?
- Prevent redirect to wp-login.php
- Insert page content into another page with a changed variable
- WordPress and PHP Version Upgrade issue [closed]
- Pull MySQL data from multiple tables and merge into 1 PHP array
- Images Uploaded saving onto older/previous year folders
- PHP Redirect condition
- WordPress 4.2.3 on Windows Server 2008 R2 Creating Files as read only
- WooCommerce “Checkout Now” button [closed]
- Finding and removing duplicates within WP Arrays
- Hard-coding a shortcode as the last menu item in primary navigation?
- couldnt show short code atts in category
- “WARNING: Found @$ in the file __ Possible error suppression is being used
- Submiting with problems on one of the options php wprdpress
- Changing ALT-tag for logo in wordpress
- str_replace remove words from title
- Woocommerce checkout page – custom field checkbox value into email
- Create form which redirects to site in network?
- Custom Plugin Develoment, Form Action
- Restrict File Type Uploads by User on Wordress via functions.php
- AJAX Returning Way Too Many Posts
- WordPress AJAX load post metadata in modal
- Add point on excerpt post
- Give permission to admin to see user’s page
- add shortcode heading showing multiple time
- List of child pages fetch next results at link click
- Limit ads appearing more than three times
- How does add_action ‘comment_post’ work?
- Showing Subcategory’s Name and Link Instead of Parent Category’s
- reorder a WP_Query, using a dropdown
- Product Search in search.php
- Background Tasks in a WP Cronjob?