One possible solution could be this –
if ( empty( $social_icons_fields ) ){
$icons .= '<style type="text/css"> .socials-icons{display: none;} </style>'; //assuming that the div which has class 'socials-icons' is the div which supposed to be not shown
return $icons;
}
Related Posts:
- Guest Author – How can I use custom fields to create guest author link?
- Creating author profiles with extra fields and exporting that data?
- Transferring author information from a custom field to a proper author
- Get author total post votes from post meta
- wordpress multi user question
- How can I change author of posts to the value of one of the custom field of the posts?
- Convert author metadata to a custom field
- author.php not showing content if Author has no Posts
- author global display format
- Calling a custom profile field only it it exists
- Where are custom field values stored in the database
- Any way to add custom options to Gallery Settings?
- Using TinyMce with textareas in meta boxes on custom post types
- How to display all custom fields associated with a post?
- passing argument to get_template_part() or a better way to code
- ACF – get_field() using ‘option’ as post_id not working
- Populating meta box with select-list of existing posts, and assigning it to custom post types
- Create meta boxes that don’t show in custom fields
- Guest Author – How to modify my custom function code if the guest author URL will follow a particular pattern/format?
- wp_editor in add_meta_boxes does not show gallery
- Move value of one custom field to another
- Deleting a custom field field
- custom field to always to .get_the_title()?
- Displaying posts with only upcoming dates according their custom field date value
- How to filter a dd/mm/yyyy date from a custom field in a query
- How do I add custom_meta_box_id’s value?
- Get a post_id where meta_value equals something in a serialized meta_value field
- little help with a mySQL query to wp database
- How do I query for a post by custom field?
- Including Database Generated Pages in Site Search [closed]
- Is it bad to use a lot of Custom Meta Fields?
- How to save media files under custom folder without changing wp-config.php or changing media settings
- How can I sort homepage by a meta value?
- Performance of storing multiple meta fields vs one JSON encoded field [duplicate]
- get_posts that match a user-specified value on a page
- Custom Metabox Not Saving
- How to add image attachment to post from a single meta key (Woocommerce)
- Custom Fields – Taller editing area
- How to add Advenced Custom Fields In Single Post
- Manipulate javascript code from custom made admin page menu
- Get updated meta value after post update or published (custom post type) using hook
- Change the main loop WordPress impact on the server?
- How to get categories with posts by custom field value?
- Meta Query returns wrong number of posts
- How to hide a custom field if there is not a value
- custom-meta-box checkboxes from loop won’t save
- Custom dropdown field added to media gallery; how to get it to save properly?
- Display Custom Field for a Specific Role, but not for Admin
- Correct syntax for retrieving custom field in CPT
- $TBA Getting Translated to $0 (Custom Fields)
- Hide text if one custom field out of two is empty [closed]
- Add custom fields to existing posts (admin pages)
- Multiple instances of TinyMCE are removing tag
- Echo the custom field value from the latest post from the ‘video’ post format?
- Custom Field – Do Not Show if Value is Empty?
- Convert attachment ID into url?
- How to query an out put value?
- What’s the best way to implement custom widgets on a per post basis?
- Displaying Meta-Box Data Properly
- Retrive Image URL of Custom Fields in Theme
- Custom search SQL Query to add custom field in result
- do_shortcode close
- Search Results Page – Displaying Custom Meta Fields
- Interrogate a page within a loop to check template type or custom meta data (Pages vs Posts)
- using advanced custom field to control css hover color
- Custom Field data only shows after manual post update
- Custom field Search with Relavanssi
- How to exclude custom fields from search queries?
- Add Custom Fields After Page Title
- Footnotes in custom fields
- wordpress get_post_meta / the_meta to output custom field value
- How to show content of custom fields in search results?
- simple fields plugin custom query
- Set class if a meta value is set within post archive
- Filtering posts by ACF meta query
- Allow HTML in Custom Metabox area
- checking liked user in wordpress rest api
- How to display selected option from dropdown list in a metabox
- How to use a custom field with add_rewrite_rule()?
- I want to change the author name
- Login Api with Meta_key and Meta_value
- User custom meta delete by serialised key value
- How to add a default field Name to post Custom Fields
- Custom Post Field -> Returning only the word “array”
- Set Value To Custom Field While Submit
- Custom Field: Display only if a specific key is selected outside the loop
- Show or hide lang=”ur” in main element
- How to use a custom field for search engine optimization
- sort a custom field base on the date or anything
- How to get the value of particular get $meta value in wordpress
- custom field as a boolean with a checkbox?
- Add image custom attribute [closed]
- Retrieving custom field as shortcode
- Hiding custom fields when content is empty [closed]
- Website that sells statistics
- Extract array from custom field
- I used a custom field for header image and can’t get it to show up on posts
- Dynamically update Custom Fields to display new dates
- save all acf options in one meta_value [closed]
- Can running a WP-Cron to update_post_meta cause performance issues?