You might try to replace the foreach( $myCarousel as $carousel ) with:
foreach($myCarousel as $carousel){
$myimg = get('projectdetails_image',1,$carousel);
if ( !$myimg ) {
// use this if you want to show a default image when no image is available in the post
$myimg = get_template_directory_uri().'/images/default_banner.jpg';
}
if ( $myimg ) {
echo "<div class="item".( $counter == 0 ? " active' : '' )."'>";
echo '<img src="';
echo $myimg;
echo '"/>';
echo "</div>";
$counter++;
$videos = get_order_field('video_vimeo');
foreach($videos as $video){
if ( get('video_vimeo',TRUE) ) {
echo "<div class="item black"><div id='video-wrap'>";
echo get('video_vimeo',1,$video);
echo "</div></div>";
}
}
}
}
Related Posts:
- Handling repeater data
- How to update custom fields using the wp_insert_post() function?
- Adding custom input for data attribute in insert media modal
- If Custom Field is empty don’t display div
- Custom Meta Field – Youtube embed
- Print html when custom field has value inside while loop
- Update WordPress Custom Field with AJAX on cached page
- How to Explode a Textarea Field and Echo each line separately, wrapped with HTML
- how to increase custom post value by one most efficiently?
- Sum custom field values of particular taxonomy
- Importing hard coded custom field into acf field
- How to iterate within Magic Fields Group foreach loop? [closed]
- how could I load a different template part by page
- Firing schema via code in functions.php doesn’t work
- How can I add extra word in permalink when someone click download button?
- Seach custom post type posts only by meta fields?
- conditional logic for front-end custom field edits
- Automatic Shortcode Creation with Custom Fields [closed]
- Custom field values to taxonomy terms
- How would an if statement surrounding a custom field with two variables (holding values) look like?
- If tag equals then show else show
- How to combine 2 php functions into one function with a custom field
- How to check if a PHP string is different than meta field?
- Display custom field on 404 page outside loop
- If ‘editor’ is empty, then
- Only show image from custom field when present
- Hide Heading if ACF Field is empty
- Custom meta box values are not getting saved for my custom post type
- How to: Conditionally Enqueue JS and Stylesheets, for Custom Post Type (Single and Archive Templates)
- WP_Query: getting posts where custom field exists
- How to show meta value code HTML after x paragraph
- Creating an image from a custom field
- User Meta Value not echoing despite Var_Dump Showing correct string
- WordPress loop by meta key that is an array? and how loop multiple arrays
- Bootstrap Carousel HTML structure and funny output [closed]
- Problem with adding custom CSS class to image in ACF Photo Gallery plugin [closed]
- Display an image based on field value
- Output custom text field as unordered list
- `update_post_meta` not working anymore
- Order a WP_Query by meta value where the value is an array
- Unable to render custom field after attempt to generate a list of recent post in page template
- Add a custom class to the body tag using custom fields
- Hide a div when a custom field is empty
- Conditional On custom field plugin metabox
- Filter unique custom field value based on custom taxonomy category or other custom field
- Meta boxes only displayed when editing normal (default wp post_type) posts
- WordPress stripping out custom field tags
- Can ‘Custom Field’ data be inserted into this Short Code?
- Using an “IF” statement based on the existence of custom field
- Query pulling a single post per month
- Woocommerce Custom Meta Boxes- How to only display if they actually have content
- Updating Metadata with Shortcode
- Adding a custom meta field with default NULL value which is not selectable
- How do you save the values from custom fields to a products data
- Is it possible to update the dataset using update_post_meta
- How to update custom fields when post is published?
- Hide a div if the fiels is empty
- Setting up a cron job to auto update a custom field
- How to add Text before my Custom Term and hide it when empty
- wp_get_nav_menu_items() with ACF
- How to bind each “the_content” elements to a custom variables
- Trying to retrieve meta values from three different meta keys and display in rows
- WP post meta – for loop inside for loop
- Posts in two different columns Bootstrap
- Store custom field’s multiple values in one user meta key
- Get field in readable word
- WooCommerce multiple custom fields code
- WP_query meta_query slow with OR and DATES
- Get meta_query value by user meta array
- meta field for numerous links
- Include a custom field in mysql query
- Display Content Based on Custom Field Value
- add class to background image
- divide custom field values in div every two values
- if user is admin display admin link and logout link else display logout only
- Add code only for blog posts
- Showing custom field contents without listing description
- If Month=Particular month display content [closed]
- How to exclude post from being queried based on custom meta value
- How to link a word comprised of a custom field with another?
- Custom field in title
- How can I put a custom field as the link of a button shortcode?
- Display WP posts in 3 responsive columns
- I want Page titles and excerpts to show up on home.php in certain order
- Posts sortable column not sorting properly for custom field numbers
- Conditional in foreach loop is outputting content twice
- ACF Date fileds to Age Convert [closed]
- Save custom field value to variable for conditional – why is this not working? [closed]
- Advanced custom fields Repeater conditional statement not working [closed]
- Metadata on the WP_Post object
- advanced custom fields: repeater field within conditional statement [closed]
- Displaying custom meta box value in a custom post page
- I want to show image from custom field image on my custom page template
- Search custom post type posts only by meta fields?
- How to pass value to add_filter wpcf7_form_tag from another function?
- ACF number less than comparison not working
- fetch from an external api call and display results in page
- hide “Open in New Tab” checkbox in link field
- Side bar only if it’s not a single post or a specific page
- Custom rest fields not loaded in rest api cpt response