-
-
Save mwangepatrick/6bddf184636c839b714b0833464ecca9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* | |
* Create ACF single destination content | |
* | |
* Intro content | |
* Intro image | |
* jquery Accordion | |
* | |
* @since 1.0.0 | |
* | |
*/ | |
function jmd_acf_single_destination_entry_content() { | |
// Custom field vars | |
$intro_image = get_field( 'destination_intro_image' ); | |
$intro_image_url = wp_get_attachment_image( $intro_image, "full"); | |
$intro_content = get_field( 'destination_intro_content' ); | |
$extra_content = the_field( 'destination_extra_content' ); | |
if ( $intro_image ) { | |
echo '<p>' . $intro_image_url . '</p>'; | |
} | |
if ( $intro_content ) { | |
echo $intro_content; | |
} | |
if( have_rows('attribute_accordion') ): | |
echo '<div id="accordion">'; | |
while ( have_rows('attribute_accordion') ) : the_row(); | |
echo '<h6 data-disabled="true">' . get_sub_field('attribute_title') . '</h6>'; | |
echo '<div>'; | |
//assuming your field is called activate gallery | |
if(get_field('activate gallery')){ | |
echo '<div class="accordion-images clearfix"> '; | |
$accordionimages = get_sub_field('attribute_gallery'); | |
if( $accordionimages ): | |
foreach( $accordionimages as $accordionimage ): | |
?> | |
<a rel="group" class="accordion-img" href="<?php echo $accordionimage['url']; ?>"> | |
<img src="<?php echo $accordionimage['sizes']['ss-accordion-img']; ?>" alt="<?php echo $accordionimage['alt']; ?>" /> | |
</a> | |
<?php | |
endforeach; | |
endif; | |
echo '</div>'; | |
} | |
echo get_sub_field('attribute_content'); | |
echo '</div>'; | |
endwhile; | |
echo '</div>'; | |
else : | |
endif; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment