$param['date_query'] = array($date_param); } $slides = new WP_Query($param); if ($slides->post_count > 0) { $slider_pause_hover = 'true'; $figure_atts = array(); $figure_atts['class'] = 'cycle-slideshow hidden-xs'; $figure_atts['data-cycle-fx'] = 'scrollHorz'; $figure_atts['data-cycle-pause-on-hover'] = $slider_pause_hover; $figure_atts['data-cycle-timeout'] = '4000'; $figure_atts['data-cycle-pager'] = '#cycle-pager'; $figure_atts['data-cycle-pager-template'] = '<a href=#><span class="glyphicon glyphicon-minus"></a>'; $figure_atts['data-cycle-prev'] = '#cycle-prev'; $figure_atts['data-cycle-next'] = '#cycle-next'; $figure_atts['data-cycle-slides'] = '> div'; $figure_attributes = array2atts($figure_atts); ?> <div id="cycle-slider"> <figure<?php echo $figure_attributes; ?> ><?php while ($slides->have_posts()) { $slides->the_post(); $post_link = get_permalink(); $post_title = get_the_title(); ?> <div class="cycle-slide"> <a class="img-link" href="<?php echo $post_link; ?>
/** * Custom Featured Thumbnail * * @since IS Simple 1.0 * ---------------------------------------------------------------------------- */ function issimple_post_featured_thumb($size = 'featured-size') { $thumb_id = get_post_thumbnail_id(); $thumb_link_full = wp_get_attachment_image_src($thumb_id, 'full'); $thumb_link_full = $thumb_link_full[0]; $thumb_caption = get_post_thumbnail_meta($thumb_id, 'caption'); if (is_full_page_template()) { $size = 'featured-full-page-size'; } $link_atts = array(); $link_atts['class'] = 'featured-link img-link'; $link_atts['title'] = get_the_title(); $link_atts['href'] = is_singular() ? $thumb_link_full : get_permalink(); $link_atts['data-lightbox'] = is_singular() ? 'post-' . get_the_ID() : ''; $link_atts['data-title'] = is_singular() ? $thumb_caption : ''; $link_attributes = array2atts($link_atts); if (has_post_thumbnail()) { ?> <figure class="post-featured-thumb"> <a<?php echo $link_attributes; ?> > <?php the_post_thumbnail($size, array('class' => 'featured-img img-responsive', 'alt' => get_the_title())); ?> </a> </figure><!-- .post-featured-thumb --> <?php } }
/** * Wraps passed links in navigational markup in Bootstrap format * * @since IS Simple 1.0 * * @param string $links Navigational links. * @param array $args Optional. Custom class for nav element. Default: 'posts-navigation'. * @return string Navigation template tag. * ============================================================================ */ function wp_bootstrap_navigation_markup($links, $args = array()) { if (empty($links)) { return; } // Set default args... $args = wp_parse_args($args, array('container' => 'nav', 'container_id' => '', 'container_class' => '', 'div_class' => '', 'screen_reader_text' => __('Posts navigation', 'issimple'))); $output = ''; if (!empty($args['screen_reader_text'])) { $output .= '<h2 class="sr-only">' . $args['screen_reader_text'] . '</h2>' . $links; } if (false !== $args['div_class']) { $div_class = array(); $div_class[] = 'pagination-content'; $div_class[] = !empty($args['div_class']) ? $args['div_class'] : ''; $output = '<div class="' . esc_attr(join(' ', $div_class)) . '">' . $output . '</div>'; } if (false !== $args['container']) { $container_atts = array(); $container_atts['id'] = !empty($args['container_id']) ? $args['container_id'] : ''; $container_atts['class'] = !empty($args['container_class']) ? $args['container_class'] : ''; $container_atts['role'] = $args['container'] == 'nav' ? 'navigation' : ''; $container_attributes = array2atts($container_atts); $output = '<' . $args['container'] . $container_attributes . '>' . $output . '</' . $args['container'] . '>'; } return $output; }