-
Author
-
October 26, 2015 at 00:19 #84131sashaDParticipant
Hello,
I created custom post type (agent listing) in my child theme, and am building single-agent.php template, I would like to put an image carousel to display images which are added to agent as custom fields. before going and downloading some other jquery script, i realise Kleo already has something which fulfills the carousel function.
Could you please give advice on how best integrate a carousel of images into a custom single template. at least which plugin kleo uses and where can i find documentation. all i need is a point in the right direction on how best integrate images carousel into my custom single template.
This theme is amazing, and i don’t want to overload it with unnecessary extra scripts or plugins. Thank you in advance,
October 27, 2015 at 03:57 #84411LauraModeratorHello, will assign the ticket to a higher support level who can help and advise you in your query.
Thanks! 🙂Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you 🙂
November 3, 2015 at 13:20 #85460sashaDParticipantHello? it’s been a weak since i asked a question, and no one has replied.
November 4, 2015 at 16:55 #85613RaduModeratorHi,
This is the shortcode for kleo images carouse
COPY CODE[vc_images_carousel images="7880,7882,7030" img_size="400x200" autoplay="yes" min_items="3" max_items="10"]
7880,7882 and 7030 represents attachment id, insert this code and replace these ID’s with your desired images.
Cheers
Radu
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionNovember 4, 2015 at 21:59 #85647sashaDParticipantHi Radu,
Thank you for reply, but your answer is for putting an individual carousel per post by hand with fixed images.
as I mentioned, I need to integrate a carousel into a template, i.e. into a single-custompost.php template, so that my custom single posts in child theme have a carousel of images associated with the relevant post.
e.g. it’s a listings website, and each custom post is a listing, and each listing has a carousel of images associated with that post.
Look forward to hearing from you,
best regards
SashaNovember 5, 2015 at 17:46 #85734RaduModeratorHi sashaD,
Please add this snippet to your kleo-child/style.css
COPY CODEfunction GetCurrentAttachmentIDs() { $GetAttchmentIDS = implode(',', array_keys(get_attached_media( 'image', get_the_ID() ))); return do_shortcode('[vc_images_carousel images="'.$GetAttchmentIDS.'" img_size="400x200" autoplay="yes" min_items="3" max_items="10"]'); } add_shortcode('attachmentID','GetCurrentAttachmentIDs');
Then when you add a post add this [attachmentID] shortcode to content to run the carousel with the associated images to that post.
If you want to carousel to be generated automatically for each CPT posts add in your created template :
COPY CODE<?php echo do_shortcode( '[attachmentID]' ); ?>
Best Regards
Radu
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionNovember 5, 2015 at 18:51 #85763sashaDParticipantDear Radu,
THANK YOU VERY MUCH! i can not show gratitude enough, as i was stuck with this thing for ages, trying to work it out myself not realizing i could ask you guys.Just a quick follow up question, how could i edit it, so that the carousel only shows when there are actual images associated with the post- so when there is no images, the carousel doesnt pop up (right now even posts without images have a carousel with blank boxes)?
all the best
SashaNovember 5, 2015 at 19:31 #85778RaduModeratorHi again,
You’re welcome @sashaD
Please update the code from functions.php with this
COPY CODEfunction GetCurrentAttachmentIDs() { if( $GetAttchmentIDS = implode(',', array_keys(get_attached_media( 'image', get_the_ID() ))) ) { return do_shortcode('[vc_images_carousel images="'.$GetAttchmentIDS.'" img_size="400x200" autoplay="yes" min_items="3" max_items="10"]'); } } add_shortcode('attachmentID','GetCurrentAttachmentIDs');
The carousel will be rendered only if the post will have attachments associated.
Best regards
Radu
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionNovember 5, 2015 at 20:05 #85788sashaDParticipantOnce again BIG THANK YOU @Radu
all working great,
MAY U HAVE A GREAT WONDERFUL DAY!!!November 6, 2015 at 16:08 #85950RaduModeratorYou’re welcome,
Also don’t forget to rate our theme on Themeforest and give it 5 stars 🙂
http://themeforest.net/downloads/
Best regards
Radu
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution -
AuthorPosts
The forum ‘General questions’ is closed to new topics and replies.