I don’t know if you can count on the order of both custom fields to be equal when returned from get_post_meta(), but if you can, you could use:
$links = get_post_meta($post->ID, 'links', false);
$URLs = get_post_meta($post->ID, 'URLs', false);
for ( $i = 0; $i < count( $links ); $i++ ) {
if ( empty( $URLs[$i] ) ) {
$URLs[$i] = '#';
}
echo '<div class="first-link bottom-dotted"><p><a href="'.$URLs[$i].'">'.$links[$i].'</a></p></div>';
}
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
- Sort posts by custom field numeric value using dropdown
- How can I display all values of a custom field from posts with a certain value of another custom field or from certain post types?
- Is there a way to do multiple ordering on a multiple meta_query?
- searching in custom meta field
- How to add upload field in a custom taxonomy?
- Display thumbnail from custom field
- Plugins won’t recognize my plugin’s hidden custom fields
- Store JSON in a custom field
- 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
- Show ACF fields only on certain page in the backend
- 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
- Save the_content into custom field
- How make a custom search on backend in WordPress without plugin?
- Create Multiple File Upload Metabox in WordPress
- WP_User_Query pulling ACF to loop
- get_posts that haven’t been assigned a specific custom field
- How to add the image URL from an external RSS feed and insert into a custom field?
- My custom backend codes shows up when i try to view my website
- Advanced Custom Fields dynamic update_field
- Custom Profile Fields move from BBpress to BuddyPress
- Sort alphabetically by custom field
- I need a “Choose from existing content” popin
- For homepage images (for small business website), is it better to use custom fields or post_thumbnail?
- get post id using custom filed value
- Passing meta_box string to post__in?
- Can data from a Custom Field data be used by a shortcode on a per page/post basis?
- How can I modify RSS item titles to be either the title or a custom meta field?
- Avoiding ACF get_field and returning to core WordPress function
- Display custom field value part by part?
- WordPress built in custom fields don’t validate or sanitize? Is there a way to fix this?
- How can I hide custom field from users used for caching response from external api?
- Cannot save underscore custom fields in one wordpress installation using xmlrpc and underscores
- Best way to contruct a global custom field?
- Diamond question mark in text after migrating content
- Display posts with empty custom field
- How to style posts selecting a CSS post_class (added through custom_fields?)?
- How to hide custom fields added by a plugin?
- Add custom data (field) to sidebar widgets for later display
- How do I convert all custom_field php timestamps in the database to js timestamps?
- 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
- show a specific metabox dependent on the page template
- excluding posts by an ACF field in pagination
- Search & column order by meta value in admin
- 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?
- How to get all wp_posts in wordpress fetched from database
- Search fails when using the radio buttons
- automatically add custom fields to post title
- Change Order of Sections Using Custom Fields
- Custom Fields Permalink Plugin not observing hyphens
- How to add content with a filter when there’s no content in the editor
- Extra text’n’image field in a page
- 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
- 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
- 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]
- Add custom fields to specific menus
- Truncating characters in Advanced Custom Fields works some places but not others?