-
Author
-
February 24, 2015 at 15:57 #47405HDcmsParticipant
Hi,
I love the dynamic aspect of the display of the archive articles
http://seventhqueen.com/themes/kleo/blog/However, I used the ACF fields (video, image) to facilitate the entry of articles by novices members
1 video article:
1 field excerp ACF + 1 field video
1 article image:
1 excerp field + 1 image fieldCurrently no image appears because I do not put feature image.
Would be possible to help me to make a hook to display the image from ACF fieldRegards
February 25, 2015 at 16:35 #47586sharmstrModeratorYou’ll have to copy /kleo/page-parts/post-content-masonry.php to your child theme and edit the Video and Image cases.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
February 26, 2015 at 14:37 #47747HDcmsParticipantHI,
Thank you 🙂
I’ll watch.
I try to centralize all the hacks in functions.php
The ideal would be to have a function like I did for a post:COPY CODEfunction affic_champs_acf_video($content) { /*champs à affichés pour une vidéo */ $content .='<div class="video, embed-container">'; $content .= get_field('video') ; $content .='</div>'; return $content; } ... if ( $format=== 'video' ) { add_filter('the_content', 'affic_champs_acf_video'); }
February 26, 2015 at 15:14 #47758sharmstrModeratorThere isnt a way to filter it.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
March 2, 2015 at 12:27 #48337HDcmsParticipantHello,
Well I have problems. I have
1) creates a new directory
wp-content/themes/kleo-child/page-parts
2) transfer the edited file
post-content-masonry.phpThere are no video appears
COPY CODE// $k_video .= '<div class="kleo-video-wrap"><video ' . join( ' ', $attr_strings ) . ' controls="controls" class="kleo-video" style="width: 100%; height: 100%;">'; $k_video .= '<div class="kleo-video-wrap"><video ' . get_field('video') . ' controls="controls" class="kleo-video" style="width: 100%; height: 100%;">';
Regards
March 2, 2015 at 15:24 #48353sharmstrModeratorLook at the lines above that. Specifically if ( !empty( $bg_video_args ) ) {. That’s going to return false if you didnt adjust the lines above that.
COPY CODEif (get_cfield( 'video_mp4' ) ) { $bg_video_args['mp4'] = get_cfield( 'video_mp4' ); } if (get_cfield( 'video_ogv' ) ) { $bg_video_args['ogv'] = get_cfield( 'video_ogv' ); } if (get_cfield( 'video_webm' ) ) { $bg_video_args['webm'] = get_cfield( 'video_webm' ); }
None of those lines are looking for your ‘video’ field, right? So it will never try to execute the line you edited.
Furthermore, did you adjust the first line in the video case? $video = get_cfield( ’embed’ ); That should probably be something like $video = get_field( ‘video’ );
I suggest you hire someone who can read and understand the code.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
March 6, 2015 at 10:12 #48935HDcmsParticipantHI,
This is the video that it was easier !! 🙂
COPY CODE.... // modif HD OK $video = get_field('video'); // video bg self hosted $bg_video_args = array(); $k_video = ''; if (get_cfield( 'video_mp4' ) ) { $bg_video_args['mp4'] = get_cfield( 'video_mp4' ); } if (get_cfield( 'video_ogv' ) ) { ...
I still can not recover an image of a picture field ACF
I replaceCOPY CODEecho '<a href="'. get_permalink() .'" class="element-wrap">' . '<img src="' . $image . '">' . kleo_get_img_overlay() . '</a>';
with
`$image = get_field(‘ecran-site’);
echo ‘<a href=”‘. get_permalink() .'” class=”element-wrap”>’
. ‘<img src=”‘ . $image . ‘”>’
. kleo_get_img_overlay()
. ‘</a>’;`March 10, 2015 at 11:32 #49465HDcmsParticipantHi,
I spent unresolved! because it remains to do the same for imagesMarch 10, 2015 at 13:32 #49473sharmstrModeratorecho $image and tell me what it prints.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
March 10, 2015 at 18:14 #49521HDcmsParticipantHi,
I replacedCOPY CODEcase 'image': default: if ( kleo_get_post_thumbnail_url() != '' ) { echo '<div class="post-image">'; $img_url = kleo_get_post_thumbnail_url(); $image = aq_resize( $img_url, $kleo_config['post_gallery_img_width'], null, true, true, true ); if( ! $image ) { $image = $img_url; } echo '<a href="'. get_permalink() .'" class="element-wrap">' . '<img src="' . $image . '">' . kleo_get_img_overlay() . '</a>'; echo '</div><!--end post-image-->'; }
by
COPY CODEdefault: $image = get_field('image'); // ok cela fonctionne echo '<a href="'. get_permalink() .'" class="element-wrap">' . '<img src="' . $image . '">' . kleo_get_img_overlay() . '</a>'; break;
it seems to work
I did not understand what use has removed the code.
I hope this is not a problem! ?? -
AuthorPosts
The forum ‘General questions’ is closed to new topics and replies.