Betiok
8/3/2017 - 1:58 PM

FAQ Accordion

FAQ Accordion

<?php if( have_rows('faq') ): ?>
	<div class="faq-wrap">
		<?php while( have_rows('faq') ): the_row(); ?>
			<?php if( get_sub_field('faq_title') ): ?>
				<h3 class="title">
					<?php the_sub_field('faq_title'); ?>
				</h3>
			<?php endif; ?>

			<?php if( get_sub_field('faq_content') ): ?>
				<div>
					<?php the_sub_field('faq_content'); ?>
				</div>
			<?php endif; ?>
		<?php endwhile; ?>
	</div>
<?php endif; ?>
if (is_page_template('template-faq.php')) {
	wp_register_style('jqueryuicss', get_template_directory_uri() . '/css/jquery-ui.css', array(), '1.12.1', 'all');
	wp_enqueue_style('jqueryuicss');

	wp_register_script('jqueryui', get_template_directory_uri() . '/js/jquery-ui.min.js', array('jquery'), '1.12.1');
	wp_enqueue_script('jqueryui');

	wp_register_script('faq', get_template_directory_uri() . '/js/faq.js', array('jquery'), '1.0.0');
	wp_enqueue_script('faq');
}
!_COMMON -> faq accordion