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 | |
function reading_time() { | |
$content = get_post_field( 'post_content', $post->ID ); | |
$word_count = str_word_count( strip_tags( $content ) ); | |
$reading_time_minutes = ceil($word_count / 200); | |
if ($reading_time_minutes == 1) { | |
$reading_time_label = 'minute'; | |
} else { |
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 | |
/* | |
* Custom Post Pagination | |
* @since 1.0.0 | |
* return | |
*/ | |
if (!function_exists('ic_custom_posts_pagination')) : | |
function ic_custom_posts_pagination($the_query=NULL, $paged=1){ | |
global $wp_query; |
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
.bike-features { | |
margin-bottom: 15px; | |
} | |
#bike-features-container { | |
min-height: 400px; | |
} | |
#bike-features-inner, #bike-options-inner { | |
visibility: hidden; |
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
jQuery(document).ready(function($){ | |
$(document).on( 'click touchstart', '#pagination a', function( event ) { | |
// Fade out the old content for a smooth transition | |
$('#bike-features-inner').fadeOut(); | |
// The pagination button you clicked will pass the page number back to the callback function | |
var page = $(this).attr('href'); |
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 | |
function ajax_pagination_enqueue() { | |
// Register and enqueue our javascript file | |
wp_register_script( 'pagination', | |
get_template_directory_uri() . '/library/js/pagination.js', // or wherever you put the file in your theme directory | |
array('jquery')); | |
wp_enqueue_script('pagination'); |
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 if( have_rows('collapse') ): ?> | |
<div id="accordion" role="tablist"> | |
<?php $i=1; while ( have_rows('collapse') ) : the_row(); ?> | |
<div class="card"> | |
<div class="card-header" role="tab" id="heading-<?php echo $i; ?>"> | |
<h5 class="mb-0"> | |
<a data-toggle="collapse" href="#collapse-<?php echo $i; ?>" aria-expanded="true" aria-controls="collapseOne"> | |
<?php the_sub_field('title'); ?> | |
</a> | |
</h5> |
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 if( have_rows('tabs') ): ?> | |
<ul class="nav nav-tabs" id="myTab" role="tablist"> | |
<?php $i=0; while ( have_rows('tabs') ) : the_row(); ?> | |
<?php | |
$string = sanitize_title( get_sub_field('tab_title') ); | |
?> | |
<li role="presentation" <?php if ($i==0) { ?>class="active"<?php } ?> > | |
<a href="#<?php echo $string ?>" aria-controls="<?php echo $string ?>" role="tab" data-toggle="tab"><?php the_sub_field('tab_title'); ?></a> | |
</li> | |
<?php $i++; endwhile; ?> |