Here you go. Because the DL, DT, DD, and UL are all within the foreach loop, that is why they are being duplicated. Here is the proper code:
function get_spec_1(){
$desc1 = get_post_meta( get_the_ID(), 'eco_mb_tp_1', true );
if( !empty( $desc1 ) ){
// Open the stuff
$code = "
<dl>
<dt class="bullet6-top">General</dt>
<dd>
<ul>";
// Loop through the items once inside the ul
foreach ( $desc1 as $d1 ){
code .="<li>$d1</li>";
}
// Close the stuff
code.="
</ul>
</dd>
</dl>
";
echo $code;
}
}
Related Posts:
- Custom Metabox Not Saving
- Custom metabox not working
- Get fields from metabox array
- Custom field/meta populated by dropdown of existing posts?
- What is the index [0] for on post meta fields?
- Gutenberg add a custom metabox to default blocks
- Custom field metabox not showing in back-end
- How to hide meta box values from custom fields list?
- How can I avoid re-inventing the Custom Fields wheel in my Plugin’s Metabox?
- Unable to get Preview of Uploaded image within a Custom Meta box
- Using media-upload.php to upload mp3 via custom fields
- Add new “Insert Into Post” button with another function
- How to store the value of a custom field dropdown select for post referencing?
- Add meta data to the menu
- Detect meta value changes when post is updated (post_updated)
- Custom Meta Boxes: Store two values in one repeatable field
- Guest Author – How can I use custom fields to create guest author link?
- post meta data clearing on autosave
- Problem in custom meta boxes
- Multiplile values checkbox or select in custom meta box
- Adding a custom field or metabox to the post-thumbnail widget?
- Auto-add paragraphs to custom field?
- Add description text under input field for new profile fields
- Custom fields to save multiple values
- Undefined index error when saving content on metabox
- Metabox with multiple fields added by user and upload box
- wp_handle_upload error “Specified file failed upload test” but still creates attachment?
- Woocommerce with metabox plugin
- How to add content at the end of posts?
- wp_editor removes paragraph from custom meta box
- WP Custom Fields Metabox Disappears – ACF plugin issue [closed]
- Where did the Add New Custom Field go?
- How Meta Data is different from Custom Fields of POST/PAGE in WordPress
- Admin meta Image Path
- Tweak Meta for Post to work it for Pages also
- Users Select inside custom metabox
- Auto Populate Custom Field with Complex Value That Increase by One?
- how to fetch the meta field keys/meta boxes from a post type?
- How to Create Dynamic Fields in a Meta Box?
- Set front page option using custom fields?
- Can’t get metabox value (a url) returned using WPAlchemy
- Display custom field values from posts on frontpage
- Custom Meta Box (SELECT) Not Saving
- Custom Attachment Caption Fields
- Why is my Custom Meta Box Field Inputs NOT saving?
- Cannot save CPT meta box
- Custom Metabox additional item
- get_posts in meta box dropdown not showing latest posts
- Outputing a metabox textarea and avoid line breaks inside li tags
- Display Custom Meta Box Field Only If Value is Present
- Problem with saving large amount of data in postmeta/usermeta
- How to use media upload on metabox post page without breaking TinyMCE?
- How to disable Edit Post and Allow only Custom Field?
- Let’s Create Custom Field Template Documentation
- Scripts and tags will not save or output from my custom meta box
- Using WP Color Picker in Repeatable Fields
- MetaBox not saving after empty
- Can I save post meta programatically without setting metaboxes?
- How do I save Multiple fields in a meta box?
- Meta box values are displayed on Custom Fields list. Is it possible to hide them?
- If metabox has content display content
- Custom meta boxes not saving
- Get meta field value of all catgories
- Help with this custom field conditional if no field is set display nothing
- How to store meta field values
- Show array of meta_value in Edit Post Coloum
- How to display data from custom fields I created?
- Custom Field & Gravity Forms [closed]
- Make separate text boxes for separate WordPress Custom Fields
- Working with multiple values and metaboxes
- Move the metaboxes to the very top of post editor
- WordPress Blocks, setAttributes not saving
- non-unique #_ajax_nonce id in browser console
- Problem with multi checkboxes value in metabox?
- Metabox/Custom fields are not saving input data
- add meta box considers the selected option as post parent
- Custom field metabox not showing in back-end
- Issue on Creating Checkbox Field On Custom Post type
- How do I display a custom field in an existing form on the front end?
- Save, update, get and sanitize post meta as HTML not plain
- Why does this javascript search function in the WordPress Admin not work?
- Create Meta boxes dynamically
- Update custom table on metabox POST
- Save input form on custom field
- how to modify a field’s size in a metabox : ROWS height, and scroll control?
- Get meta value when the page is a blog archive
- Custom Meta Boxes and Fields for WordPress: Change directory upload based on user-edit page
- wp_postmeta are updated for only one page
- Meta Box Data added to header redirect
- Custom metaboxes not saving after switching themes
- I want my post to republish again after adding a custom field
- added a meta box to post however when saving menu while debug on throws a warning
- Meta boxes not displayed, data isn’t being saved
- Create citation and url in post using 3 custom fields with conditions for each field… So close!
- Including inline Custom Fields info with add_filter in functions.php
- Creating an If/Else statement using WPAlchemy MetaBox radio boxs
- Display custom meta box in my template file
- Display custom field value into content with hyperlink
- Using CMB2 Plugin to create text_date metabox (datepicker) How do I save multiple dates? [closed]
- Dynamic background image used in css after selector