The reason your custom fields are only showing up when there is post content is due to this line:
<?php if( get_the_content() ):?><h3>
Everything after that line will only appear if get_the_content() returns something truthy. The reason being that you’re using a shorthand if statement and not closing to before the custom field logic Try this:
>
<?php if( get_the_content() ):?><h3>
<?php
//this closes the if statment
endif;
?>
<?php
echo types_render_field("nome-do-aeroporto", array("argument1"=>"value1","argument2"=>"value2","argument2"=>"value2"));
?>
<br/>
<?php
echo types_render_field("cidade", array("argument1"=>"value1","argument2"=>"value2","argument2"=>"value2"));
?>
I am wondering why your using that if statement in the first place however.
Hope this helps
Related Posts:
- Set the transport of the Customizer ‘header_image’ core setting to ‘postMessage’
- Widgets not showing in my custom theme
- Customizer: Output default value in Customizer CSS
- Customizer: active_callback and sanitize_callback incompatibility?
- Saving and Restoring a Canvas on A Individual User Basis
- Compare the old get_theme_mod($name) to the new get_theme_mod($name) return value
- How Do I Find & Remove H1 From Site-Title-Wrapper? [closed]
- Display movies that apear this day next
- How can I add diffrent editable text fields?
- Trying to update Woocommerce meta values
- Inserting a class on before_widget if checkbox is checked
- Where can I find the code for the menu page meta boxes?
- How to remove the intro animation which appears during the load up of some WordPress themes? [closed]
- esc_attr() right way and use
- Cleaning up WordPress to improve performance?
- List of all theme customizer control types?
- Show the most popular post per week
- Add a class to links in the visual editor (how to get old dialog back)
- Creating custom Woocommerce attribute taxonomies from a plugin
- Detection of theme being used
- How to handle a custom form in wordpress to submit to another page?
- Load post content into iframe
- wp_customize_image_control default value
- WooCommerce: How to display item meta data in email confirmation using woocommerce_order_item_meta_end
- How to use multiple query with same meta key
- Replacing mysql_real_escape_string in WordPress theme
- The best way to customize “nav-menu-template.php” to add if the ‘link_before’ is “checkbox”
- Can’t Find a Way to Edit the Home Page Content [closed]
- Fatal error: Call to undefined function wpsc_cart_item_count()
- Removing WordPress profile fields from non-admins
- Overriding a theme redux file in child theme
- Use ajax to update_post_meta
- How to display custom field on homepage
- If Meta Checkbox is checked, do something?
- Show custom field if it exists, and show different elements if it doesn’t
- How to get 2 or multiple custom post types in wordpress functions.php
- Can’t load WP function into external function
- Custom field value not saving when it contains a URL?
- Creating bulk posts with Youtube videos
- Trouble creating conditional PHP for nav menu items with children for custom Walker
- tracking number field in Woocommerce order [closed]
- Sort posts by custom fields value using dropdown menu
- WordPress: Access a plugin from within a theme
- Retrieve $_POST data submitted from external URL in WordPress(NOT API)
- Need Help Fixing My Iframes [closed]
- My page.php shows the index.php
- How to add a do_action on refreshing of WP customizer?
- Weird 404 URL Problem – domain name being placed at end of urls
- Trouble checking if custom woocommerce checkout field is empty or not
- Add / Update Custom Fields After Select Pictures in Media Window
- How do I link a button I created in theme customizer to a function?
- How to change theme programmatically from a external application?
- Remove the last X characters of a custom field value
- How to obtain the current website URL in my theme?
- Separation of presentation and code – WordPress
- Why are the details of my todo not saving?
- Can’t save php string to a custom field
- Hook called before text widget save
- get_template_directory adding FTP root folders in urls
- str_replace with the_content is not working
- Changing the order of custom fields in the dashboard for Woocommerce variable products [closed]
- How to Update an old theme for the latest wordpress version
- Handling repeater data
- List of Events with Multiple Dates: Only NEXT Date
- Including Custom fields within the_content
- How can i make a search box to search by custom field
- ‘Bones’ theme: Load stock scripts in footer instead of header?
- call a string/function from database
- Display Custom Field in Sidebar if Value is Present
- Using a string from a custom field within a link
- Make separate text boxes for separate WordPress Custom Fields
- How do I use an iFrame for my header in WordPress twenty seventeen?
- Hide A Class and Add Custom HTML Code Using WordPress
- When I click for the redirect link it is showing the content of index.php instead of single_assignment_page.php
- How to use data URL in WordPress?
- Dynamic “home” image and URL based on current folder
- Sum All the Post Meta of Published posts of Current Logged in user
- WordPress child theme, creating a custom php template page
- How to get Post sidebar & footer including html like get_the_content() which only gets content section?
- Menu to the right of screen on desktop using Bootstrap 4
- Autoloading Classes in Plugins
- Automatically refresh page if widget is added to page?
- Beginner Developing Theme with Bootstrap – NavMenu question
- How to use something like meta_query but for fields?
- Local WordPress from Git repo, where to set document root?
- Show content by using tags
- php if, else & custom fields – syntax error
- Use custom get results query to show posts WordPress
- Best way to define a database with product codes and back-end support?
- Shortcode Display From WordPress Dashboard Page Without Using post_id
- wp_customize_image_control default value
- How to add button to top of theme customizer?
- How can I add more code to this?
- Edit the Publish Widget Options
- Display custom meta box in my template file
- Predefine Magazine Style Layouts
- Too many if’s and else if’s ?? – Must be better way [closed]
- Advanced Custom Fields Show PHP in Text Areas
- New to WordPress & Freelancing [closed]
- How to store the_post_thumbnail() value in a variable