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
- ORDER BY custom field value
- Can serialized arrays in DB be matched against serialized arrays with meta_query?
- Create a select drop down of available menus
- Cannot edit post meta fields with rest API
- Only display custom field if it there is a value inside
- Slow meta query with multi meta keys
- Custom Field Multiple Clauses
- Custom field values repeating
- Send Multiple Custom Field Values Through the URL
- $wp_query meta_key naming issue [closed]
- Meta_query and numeric comparison [closed]
- Separate table or usermeta
- Woocommerce with metabox plugin
- using multiple meta_key and meta_value in query_posts
- How to add a new meta key and assign timestamp to posts
- Print custom field in Query Loop block
- Is there a simpler version of WP Media?
- Order RSS content by an advanced custom field value
- Advanced search by two criteria – sort by location and date (ascending or descending)
- Add microdata from schema.org [closed]
- Displaying multiple URLs as custom field values
- Pass current post title to a predefined link
- Create new custom post and post category of same name
- shortcode in a custom metabox
- How to make the ‘delete’ button inactive on some categories?
- Notice: Trying to get property of non-object in : custom fields category
- Importing WordPress Posts With Custom Meta Data As CSV Files Through PHPMyAdmin
- How can php be used to return data from custom fields in a post?
- Get meta field value of all catgories
- Displaying a custom field in Category Archives
- Custom Fields Value As Taxonomy
- Change Page Order by Custom Field (Magic Fields)
- Adding tinymce to Custom Field boxes on Category edit page
- Custom Field is getting the value of another page/post instead of the current one?
- Use value from ACF to populate other fields
- Dynamically populate query source in Elementor post widget
- Adding Facebook’s image and meta description retrieval capabilities to a WordPress post
- WooCommerce 3 get custom variation on process order [closed]
- query_posts -> get page_id from custom field
- display custom media folders to wordpress media popup
- Should I store arrays in custom fields or create custom tables?
- Problem saving meta data
- Custom Meta Boxes and Fields for WordPress: Change directory upload based on user-edit page
- WP_query returns error when used for custom widget
- Form fields based on custom fields
- woocommerce how in checkout to add my custom field check box, and when i check it hide the shipping adress and add tax 19% [closed]
- How can I attach files without using a plugin?
- Change Fields of Comments and make them searchable?