try this one..
<div style="display:<?php $meta_city = get_post_meta( get_the_ID(), 'city', true );
if ($meta_sub_img == '') {
echo 'none';
} else {
echo 'block';
}
?>;">
<!--- your content --->
</div>
Related Posts:
- Add filter menu to admin list of posts (of custom type) to filter posts by custom field values
- Is there any action filter/hook for validating a custom field before publishing the post?
- Filter WP_Query for posts having a certain meta-value
- Apply the_content filter to a custom field with multiple values
- Pass all custom fields through the same filter on post load?
- Filter results with custom field values and dropdown
- Archive sorting functions by custom fields (front-end)
- Change content before writing to database
- WordPress Search Custom Meta Field Only
- How do I assign this filter to a variable? (Appending php & markup to the_content)
- Using custom fields in a filter hook
- Add an advert every nth Paragraph
- How to filter a dd/mm/yyyy date from a custom field in a query
- Force hide custom field metaboxes
- Saving custom profile fields
- Escaping Quotes
- How to sort category by custom field value
- Update posts after populating ACF field value [closed]
- How to validate custom field on lost password form before the user id field?
- filtering custom post types via meta data drop down
- global function to apply filter to custom field
- How to select posts from multiple categories and metavalues?
- How to order posts by one custom field and filter them by another one?
- Filter multiple custom fields Values with Check boxes
- Trying to sort and display categories(not posts) by custom field: ‘order’
- Redirect to another page using contact form 7? [closed]
- How to Wrote Simple Calculations by Using Custom Fields in Loop?
- Get categories query not working in function.php
- Best filter to use for modifying custom fields on a post?
- How to display childrens custom fields?
- Access ACF fields within custom preview function?
- Sort posts by clicks on download button
- “Virtual category page” based on a custom field filter
- Let Users Filter Posts by Custom Fields
- Custom Theme Fields in Settings Menu – apply filters to one of those fields?
- Footnotes in custom fields
- How to change permalink on headlines in rss feeds?
- How to change order of posts in admin
- How to query posts by month based on date custom field?
- Filter or order based on custom field
- How to show ACF fields in Gridbuilder custom block
- WP meta_query args not working in function
- User Filter Options on Archive Page
- How to add content with a filter when there’s no content in the editor
- change attachment custom field onChange event
- Filter and display a specific custom field value [closed]
- How to filter post using custom feild value in shortest and longest duration?
- Query Posts Via WordPress URL
- Create widget that filters posts on current page based on entered value
- Including inline Custom Fields info with add_filter in functions.php
- Sort posts after filtering them through multiple taxonomies
- Set new url from custom post field
- meta_value and meta_key filtering returning no posts [closed]
- Show image if author meta (profile fields) exists outside loop
- Displaying custom filed content instead of post content
- Adding “meta” info to WP site PHP function?
- WordPress built in custom fields don’t validate or sanitize? Is there a way to fix this?
- How can i retrive a text from a custom field
- IF Custom field value equals ZERO
- WordPress Media Uploader custom Javascript not working
- Targeting categories in custom fields
- Custom fields issue [closed]
- Querying posts by latitude and longitude to build a Google Maps with several markers
- How can I hide custom field from users used for caching response from external api?
- Select custom posts by meta_value and sort by a different meta value
- Attach images to posts using custom fields (just paths to images already uploaded)
- how to display custom fields of post on a web page
- “Matching” or “Linking” Two WordPress Pages: Custom Fields?
- Hide custom fields when empty
- List custom field values in alphabetical order without repetition
- Changed PHP handler to DSO – weird custom fields problem [closed]
- Getting the Featured image URL and inserting it as Custom Field on Post update / publish
- Build index page from custom fields
- Can’t query by meta_key
- Adding custom field and querying from post table
- Display MP3 as media using an URL from a custom field
- Only show when content added via custom field
- How to use media upload on metabox post page without breaking TinyMCE?
- How do i get the attached images with custom value checked?
- How to disable Edit Post and Allow only Custom Field?
- Importing WordPress Posts With Custom Meta Data As CSV Files Through PHPMyAdmin
- Using a custom field inside a shortocde
- Convert attachment ID into url?
- Add Custom Profile Field as Notes
- Inserting data into MagicFields using mysql queries
- Custom Field box history
- How do I query the title (or handle?) of post meta fieldset (created with Simple Fields Plugin)
- How to query an out put value?
- Check & remove special characters in a field?
- Google map that plot’s several markers – each one with custom data
- What’s the best way to implement custom widgets on a per post basis?
- How can I use custom properties to set different background on different pages?
- echo get_post_meta of all post in a category to fill up a select field
- Displaying Meta-Box Data Properly
- Let’s Create Custom Field Template Documentation
- How can I combine this php statement to get the results of multiple variable inputs?
- Copy price categories to custom field
- wp custom field date format compare
- Overriding default calendar to show posts from a category
- Save all the post tags inside a custom field