All you have to do to hide this link is to check, if it’s empty:
<?php if ( $link = get_post_meta($post->ID, 'mp3_link1', true) && trim($link) ) : ?>
<a href="https://wordpress.stackexchange.com/questions/326188/<?php echo esc_attr($link); ?>" target="_blank">MP3</a>
<?php endif; ?>
Related Posts:
- Custom post meta field effect on the performance on the post
- Difference between meta keys with _ and without _ [duplicate]
- Orderby meta_value only returns posts that have existing meta_key
- Can I query custom meta data through WP_Query
- Having different sidebar content for MANY pages?
- Add custom objects/entities to WordPress
- Change behavior of “Insert into Post” based on attachment metadata
- Is there a way to do multiple ordering on a multiple meta_query?
- searching in custom meta field
- Plugins won’t recognize my plugin’s hidden custom fields
- Store JSON in a custom field
- How do I assign this filter to a variable? (Appending php & markup to the_content)
- If value present, order posts by two consecutive custom fields
- Custom contact form 7 select with custom values [closed]
- Save page data to an xml file
- Create Posts using Import>RSS/WXR/XML and pass values to Custom Fields
- Best way to add custom / magic / flutter fields into RSS feed
- Setting orderby to a custom field using pre_get_posts
- How to save a ToggleControl value in a meta field?
- How to get multiple checkboxes in one meta field
- Adding Custom Fields to Search
- How to Display Custom Meta Box only on Specific Page IDs
- Get custom field label
- How do I get the url slug inside the dashboard for a custom post type?
- How do I use Ajax to build a dropdown of custom fields based on a post selected in previous dropdown?
- Register rest field for specific user
- Custom Field Suite A little problem
- How to wrap meta values seperated by comma in ? [closed]
- Create WordPress shortcode with php code inside
- custom field not saved
- How to create a Custom Meta Box with Name/Value Admin User Input Fields?
- Auto-remove custom field with no value on publish
- Is it better practice to use ‘This Name Format’ or ‘this-name-format’ for custom fields?
- Custom Fields box in the post editor: Replace textareas with input elements
- Hide custom meta data if empty
- Passing args to WP_User_Query am I using meta correctly?
- How to get latest post value if first post is empty in wordpress
- Custom fields attached to a page template only show on edit screen when page is saved
- Define a post’s title and slug from Custom Fields
- Value from custom field is not being displayed?
- Can I access a post meta field before the loop?
- wrap text around custom fields array
- Displaying page image in the footer automatically
- Hide custom column in admin template screen (Elementor) [closed]
- What is the largest value you can store in a custom field (as meta data for a post)?
- ORDER BY custom field value out of where clause
- Show image if author meta (profile fields) exists outside loop
- How can i retrive a text from a custom field
- List custom field values in alphabetical order without repetition
- Can’t query by meta_key
- ACF: How to get users with a ACF flexible content subfield with a specific value AND layout?
- WordPress custom fields feature is missing in my installation
- Is it possible to populate a custom field with content from a page
- Buik update custom field values from external API
- Save all custom field data into one “master” custom field
- Change a custom field value after X number of seconds
- How to put forward a blog post
- Plugin or shortcode for ISBN number?
- HM CMB: Role Select
- Jquery on custom-field backend
- Display latest post depending on Meta Box content
- WP-eComerce Advance Meta Tag data in descending order [closed]
- Custom fields won’t update
- Replacing custom field with shortcode
- WPAlchemy issue when using 2 select menus with the same values inside a repeating group
- How to use custom fields like Title to show value in content?
- Populate custom checkout fields with data from previous orders
- Expire Date Condition not Working ACF WordPress
- Making custom meta box required (with error message if not filled in) on Gutenberg
- Is the use of many custom field not good for server?
- Changing form action based on selected value
- How can I ‘check’ the “custom fields” box from the Screen Options?
- Very large list of options for BuddyPress profile fields
- Can you generate a featured image from two images from custom fields?
- Search fails when using the radio buttons
- Change Order of Sections Using Custom Fields
- How to add content with a filter when there’s no content in the editor
- Text in header as a page – hide from Web crawlers
- When post is updated, custom metadata in text area field is overwritten
- Order a query by meta_value and then by post_date
- custom field functionality
- Media Attachment Custom Meta Fields not saving in Media Uploader when using jQuery UI Autocomplete
- Custom Fields – How can I remove the publish option for certain users
- Can i categorise my meta box?
- How to overwrite a value for a custom field?
- WordPress archives by custom field and date
- Decouple page name from page title
- Custom Field add markup to line breaks
- When editing a post with a custom meta box the values aren’t displaying correctly
- Function to retrieve a picture if there is no picture is attached
- Show posts containing or not custom field
- Use Metabox to enter Post Title
- Include custom fields into the content of a regular page
- Bypassing a Form Options
- add_post_meta insert null value into Database
- How to implement jquery-ui autocomplete into custom fields?
- extra post fields for url + youtube video / implementation
- i want to send email on custom post field (job_status == 2) but it is not working
- How to create a searchable database with a single-field search box at the front end? [closed]
- Archive for custom fields?