
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
I've created the following code snippet and added the "Code Snippet" plugin:
- hidden link
function toolset_homepage_slideshow_count_shortcode() {
global $post;
if ( ! $post instanceof WP_Post ) {
return 0;
}
$values = get_post_meta(
$post->ID,
'wpcf-homepage-slideshow',
false // Return all values for the repeating field.
);
return count( $values);
}
add_shortcode('toolset_homepage_slideshow_count','toolset_homepage_slideshow_count_shortcode');
The above shortcode will return the total number of images you uploaded for the repeating field and then I've added the following conditional shortcode within the following view's "Loop Editor" section.
=> hidden link
[wpv-conditional if="( '[toolset_homepage_slideshow_count]' eq '1' )"]
<style>
.glide__arrows { display:none; }
</style>
[/wpv-conditional]
Can you please confirm it works as expected now.
Minesh,
This work beautifully. Thank you!
Saul