/** * Get content for individual slide including * headline, description, and button. * * @since 1.1.0 * * @param array $slider ID of slider * @param array $slide Data for individual slide * @param array $settings Settings for slider * @param string $slider_type Type of slider, standard, nivo, carrousel, bootstrap, or fallback * @return string $output Final HTML markup for content section */ function themeblvd_get_slide_content($slider, $slide, $settings, $slider_type = 'standard') { $output = ''; if (themeblvd_slide_has_element('headline', $slide) || themeblvd_slide_has_element('description', $slide) || themeblvd_slide_has_element('button', $slide)) { // Setup markup to wrap content area. $wrap_class = 'content'; if ($slide['position'] != 'full') { $wrap_class .= ' grid_fifth_2'; } $wrap_fmt = apply_filters('themeblvd_slide_content_wrap', '<div class="' . $wrap_class . '"><div class="content-inner">%s</div></div>'); $content = ''; // Headline if (themeblvd_slide_has_element('headline', $slide)) { $content .= sprintf('<div class="slide-title"><span>%s</span></div>', apply_filters('themeblvd_sliders_headline_text', stripslashes($slide['elements']['headline']))); } // Description + Button if (themeblvd_slide_has_element('description', $slide) || themeblvd_slide_has_element('button', $slide)) { $desc = ''; // Description text if (themeblvd_slide_has_element('description', $slide)) { $text = apply_filters('themeblvd_sliders_desc_text', stripslashes($slide['elements']['description'])); if (apply_filters('themeblvd_' . $slider_type . '_slider_desc', true, $slide, $slider, $settings)) { $text = apply_filters('themeblvd_the_content', $text); } $desc .= sprintf('<div class="slide-description-text">%s</div>', $text); } // Button if (themeblvd_slide_has_element('button', $slide)) { $button_atts = apply_filters('themeblvd_' . $slider_type . '_slider_button', array('text' => apply_filters('themeblvd_sliders_button_text', $slide['elements']['button']['text']), 'url' => $slide['elements']['button']['url'], 'color' => 'default', 'target' => $slide['elements']['button']['target'], 'size' => 'medium'), $slide, $slider, $settings, $slider_type); $desc .= sprintf('<div class="slide-description-button">%s</div>', themeblvd_button(stripslashes($button_atts['text']), $button_atts['url'], $button_atts['color'], $button_atts['target'], $button_atts['size'])); } $content .= sprintf('<div class="slide-description"><div class="slide-description-inner">%s</div></div>', $desc); } // Wrap and finalize content $output = sprintf($wrap_fmt, $content); } return apply_filters('themeblvd_slide_content', $output, $slider, $slide, $settings, $slider_type); }
/** * Popup (from Bootstrap) * * @since 1.0.0 * * @param array $atts Standard WordPress shortcode attributes * @param string $content Content in shortcode * @return string $output Content to output for shortcode */ function themeblvd_shortcode_popup($atts, $content = null) { $default = array('text' => 'Link Text', 'title' => '', 'color' => 'default', 'size' => '', 'icon_before' => '', 'icon_after' => '', 'header' => '', 'animate' => 'false'); extract(shortcode_atts($default, $atts)); // ID for popup $popup_id = uniqid('popup_' . rand()); // Button/Link $link = ''; if ($title) { $title = $text; } $link = themeblvd_button($text, '#' . $popup_id, $color, null, $size, null, $title, $icon_before, $icon_after, 'data-toggle="modal"'); $link = apply_filters('themeblvd_the_content', $link); // Classes for popup $classes = 'modal'; if ($animate == 'true') { $classes .= ' fade'; } // Header $header_html = ''; if ($header) { $header_html .= '<div class="modal-header">'; $header_html .= '<button type="button" class="close" data-dismiss="modal">×</button>'; $header_html .= '<h3>' . $header . '</h3>'; $header_html .= '</div><!-- modal-header (end) -->'; } // Output $output = $link; $output .= '<div class="' . $classes . '" id="' . $popup_id . '" tabindex="-1" role="dialog" aria-hidden="true">'; $output .= '<div class="modal-dialog">'; $output .= '<div class="modal-content">'; $output .= $header_html; $output .= '<div class="modal-body">'; $output .= apply_filters('themeblvd_the_content', $content); $output .= '</div><!-- .modal-body (end) -->'; $output .= '<div class="modal-footer">'; $close_class = 'btn btn-default'; if (apply_filters('themeblvd_btn_gradient', false)) { $close_class .= ' btn-gradient'; } $output .= '<a href="#" class="' . $close_class . '" data-dismiss="modal">' . themeblvd_get_local('close') . '</a>'; $output .= '</div><!-- .modal-footer (end) -->'; $output .= '</div><!-- .modal-content (end) -->'; $output .= '</div><!-- .modal-dialog (end) -->'; $output .= '</div><!-- .modal (end) -->'; return $output; }
/** * Display slogan. * * @since 2.0.0 * * @param array $args All options for slogan * @return string $output HTML output for slogan */ function themeblvd_slogan($args = array()) { // Setup and extract $args $defaults = array('slogan' => '', 'text_size' => 'large', 'button' => 1, 'button_text' => 'Get Started Today!', 'button_color' => 'default', 'button_size' => 'large', 'button_url' => '', 'button_target' => '_self'); $args = wp_parse_args($args, $defaults); extract($args, EXTR_OVERWRITE); // Wrapping class $class = $button ? 'has_button' : 'text_only'; $text_class = 'text_' . $text_size; // Output $output = '<div class="tb-slogan ' . $class . '">'; if ($button) { $output .= themeblvd_button(stripslashes($button_text), $button_url, $button_color, $button_target, $button_size); } $output .= '<span class="slogan-text ' . $text_class . '">' . stripslashes(do_shortcode($slogan)) . '</span>'; $output .= '</div><!-- .slogan (end) -->'; return $output; }
/** * Use themeblvd_button() function for read more links. * * When a WP user uses the more tag <!--more-->, this filter * will add the class "btn" to that link. This will allow * Bootstrap to style the link as one of its buttons. * * This function is used with WP filter "the_content_more_link" * * @since 2.2.0 */ function themeblvd_read_more_link($read_more, $more_link_text) { $args = apply_filters('themeblvd_the_content_more_args', array('text' => $more_link_text, 'url' => get_permalink() . '#more-' . get_the_ID(), 'color' => 'default', 'target' => null, 'size' => null, 'classes' => null, 'title' => null, 'icon_before' => null, 'icon_after' => null, 'addon' => null)); // Construct button based on filterable $args above $button = themeblvd_button($args['text'], $args['url'], $args['color'], $args['target'], $args['size'], $args['classes'], $args['title'], $args['icon_before'], $args['icon_after'], $args['addon']); return apply_filters('themeblvd_read_more_link', $button); }
"> <div class="article-wrap"> <article id="post-<?php the_ID(); ?> " <?php post_class(); ?> > <div class="entry-content"> <?php themeblvd_the_post_thumbnail(themeblvd_get_att('location'), themeblvd_get_att('crop')); ?> <h2 class="entry-title"> <?php themeblvd_the_title(); ?> </h2> <?php the_excerpt(); ?> <?php echo themeblvd_button(themeblvd_get_local('read_more'), get_permalink(get_the_ID()), 'default', '_self', 'small', 'read-more', get_the_title(get_the_ID())); ?> </div><!-- .entry-content --> </article><!-- #post-<?php the_ID(); ?> --> </div><!-- .article-wrap (end) --> </div><!-- .grid-item (end) -->
/** * Default display for action: themeblvd_content * * @since 2.0.0 * * @param string $type Type of content -- content or excerpt */ function themeblvd_blog_content_default($type) { if ($type == 'content') { // Show full content the_content(apply_filters('themeblvd_the_content_more_text', themeblvd_get_local('read_more'))); } else { // Show excerpt and read more button $args = apply_filters('themeblvd_the_excerpt_more_args', array('text' => themeblvd_get_local('read_more'), 'url' => get_permalink(), 'color' => 'default', 'target' => '_self', 'size' => null, 'classes' => null, 'title' => null, 'icon_before' => null, 'icon_after' => null, 'addon' => null, 'p' => true)); // Output excerpt the_excerpt(); // Output button $button = themeblvd_button($args['text'], $args['url'], $args['color'], $args['target'], $args['size'], $args['classes'], $args['title'], $args['icon_before'], $args['icon_after'], $args['addon']); if ($args['p']) { $button = '<p>' . $button . '</p>'; } echo $button; } }
/** * Slidebar mobile fallback * * @since 1.0.0 * * @param string $slider ID of current slider * @param array $slides Current slides for slider * @param string $fallback Type of fallback, full_list or first_slide * @param array $settings All current settings for slider */ function themeblvd_slider_fallback_default($slider, $slides, $fallback, $settings = array()) { echo '<div class="slider-fallback">'; echo '<div class="slider-fallback-inner ' . $fallback . '">'; if ($slides) { echo '<ul class="slider-fallback-list">'; foreach ($slides as $slide) { echo '<li class="slider-fallback-slide">'; echo '<div class="slider-fallback-slide-body">'; if (isset($slide['custom'])) { // Custom Slide echo apply_filters('themeblvd_sliders_custom_content', $slide['custom']); } else { // Headline if (themeblvd_slide_has_element('headline', $slide)) { printf('<h2>%s</h2>', stripslashes($slide['elements']['headline'])); } // Media (Image or Video) themeblvd_slide_media(themeblvd_sliders_get_media_atts($slider, $slide, $settings, 'fallback'), array(), 'fallback'); // Description if (themeblvd_slide_has_element('description', $slide)) { $text = stripslashes($slide['elements']['description']); if (apply_filters('themeblvd_fallback_slider_desc', true, $slide, $slider, $settings)) { $text = apply_filters('themeblvd_the_content', $text); } printf('<div class="slide-description-text">%s</div>', $text); } // Button if (themeblvd_slide_has_element('button', $slide)) { $button_atts = apply_filters('themeblvd_fallback_slider_button', array('text' => $slide['elements']['button']['text'], 'url' => $slide['elements']['button']['url'], 'color' => 'default', 'target' => $slide['elements']['button']['target'], 'size' => 'medium'), $slide, $slider, $settings, 'fallback'); printf('<div class="slide-description-button">%s</div>', themeblvd_button(stripslashes($button_atts['text']), $button_atts['url'], $button_atts['color'], $button_atts['target'], $button_atts['size'])); } } echo '</div><!-- .slider-fallback-slide-body (end) -->'; echo '</li>'; // End the loop after first slide if we're only showing the first slide. if ($fallback == 'first_slide') { break; } } // End foreach ($slides) echo '</ul><!-- .slider-fallback-list (end) -->'; } // End if ($slides) echo '</div><!-- .slider-fallback-inner (end) -->'; echo '</div><!-- .slider-fallback(end) -->'; }