"> <?php // Query the post list $post_list = new WP_Query(themeblvd_get_second_query()); // Start the loop if ($post_list->have_posts()) { while ($post_list->have_posts()) { $post_list->the_post(); global $more; $more = 0; // Get template part, framework default is content-list.php get_template_part('content', themeblvd_get_part('list_paginated')); } } else { // No posts to display printf('<p>%s</p>', themeblvd_get_local('archive_no_posts')); } themeblvd_pagination($post_list->max_num_pages); wp_reset_postdata(); ?> </div><!-- .post_list (end) --> <?php themeblvd_content_bottom(); ?> </div><!-- .inner (end) --> </div><!-- #content (end) --> <!-- CONTENT (end) --> <?php
<a href="<?php echo wp_get_attachment_url(get_the_ID()); ?> " title="<?php the_title(); ?> " rel="attachment"> <?php echo wp_get_attachment_image(get_the_id(), 'full'); ?> </a> </p> <?php } ?> <?php the_content(); ?> <div class="clear"></div> <?php wp_link_pages(array('before' => '<div class="page-link">' . themeblvd_get_local('pages') . ': ', 'after' => '</div>')); ?> <?php edit_post_link(themeblvd_get_local('edit_post'), '<p class="edit-link clearfix">', '</p>'); ?> </div><!-- .entry-content --> </article><!-- #post-<?php the_ID(); ?> -->
<?php $text = themeblvd_get_local('search'); ?> <div class="themeblvd-search"> <form method="get" action="<?php echo home_url('/'); ?> "> <div class="controls"> <input type="text" class="search-input" name="s" placeholder="<?php echo $text; ?> " /> <button class="btn btn-default" type="submit"><i class="icon-search"></i></button> </div> </form> </div>
/** * Setup JavaScript localized strings for * themeblvd.js * * The filter "themeblvd_js_locals" * can be used to add/remove strings or other * variables we want to pass through to our primary * "themeblvd" script. * * @since 2.2.0 */ function themeblvd_get_js_locals() { // Start $locals array with any miscellaneous stuff $locals = array('thumb_animations' => 'true', 'featured_animations' => 'true', 'image_slide_animations' => 'true', 'retina_logo' => 'true'); // Extend $locals to accomodate scripts being included // through our "themeblvd_global_config" filter. // This allows people to remove jQuery plugin files // w/out having to also remove functions from themeblvd.js. if (themeblvd_supports('assets', 'bootstrap')) { $locals['bootstrap'] = 'true'; } // Magnific Popup Lightbox integration if (themeblvd_supports('assets', 'magnific_popup')) { $locals['magnific_popup'] = 'true'; // Magnific Popup animation $locals['lightbox_animation'] = themeblvd_get_option('lightbox_animation'); // Disable standard lightbox on mobile? if ('yes' == themeblvd_get_option('lightbox_mobile')) { $locals['lightbox_mobile'] = '768'; } else { $locals['lightbox_mobile'] = '0'; } // Disable iframe lightboxes (i.e. video, google maps) on mobile? if ('yes' == themeblvd_get_option('lightbox_mobile_iframe')) { $locals['lightbox_mobile_iframe'] = '768'; } else { $locals['lightbox_mobile_iframe'] = '0'; } // Disable gallery lightboxes on mobile? if ('yes' == themeblvd_get_option('lightbox_mobile_gallery')) { $locals['lightbox_mobile_gallery'] = '768'; } else { $locals['lightbox_mobile_gallery'] = '0'; } // Text strings $locals['lightbox_error'] = themeblvd_get_local('lightbox_error'); $locals['lightbox_close'] = themeblvd_get_local('close'); $locals['lightbox_loading'] = themeblvd_get_local('loading'); $locals['lightbox_counter'] = themeblvd_get_local('lightbox_counter'); $locals['lightbox_next'] = themeblvd_get_local('next'); $locals['lightbox_previous'] = themeblvd_get_local('previous'); } // Superfish for drop down menus if (themeblvd_supports('assets', 'superfish')) { $locals['superfish'] = 'true'; } // Return with framework's filter applied return apply_filters('themeblvd_js_locals', $locals); }
clearfix" role="main"> <div class="inner"> <?php themeblvd_content_top(); ?> <?php if (has_action('themeblvd_builder_content')) { ?> <?php do_action('themeblvd_builder_content'); ?> <?php } else { ?> <p class="warning"><?php echo apply_filters('no_builder_message', themeblvd_get_local('no_builder_plugin')); ?> </p> <?php } ?> <?php themeblvd_content_bottom(); ?> </div><!-- .inner (end) --> </div><!-- #content (end) --> <!-- CONTENT (end) --> <?php get_sidebar('right');
<?php /** * The template used for displaying content in 404.php */ ?> <article> <div class="entry-content"> <h1><?php echo themeblvd_get_local('404_title'); ?> </h1> <?php echo themeblvd_get_local('404'); ?> </div><!-- .entry-content --> </article>
/** * Display custom layout within template_builder.php * page template. * * When each element is displayed, it is done so with * an external function. This will allow some elements * to be used for other things such as shortcodes. * However, even elements that shouldn't have an external * function do to allow those elements to be indidivually * edited from a child theme. * * @since 1.0.0 * * @param string $layout_id Post ID for custom layout * @param string $location Location of elements, featured or primary */ function themeblvd_builder_elements($layout_id, $location) { $api = Theme_Blvd_Builder_API::get_instance(); // Setup $counter = 0; $primary_query = false; if (!$layout_id) { // This should rarely happen. A common scenario might // be the user setup a page with a layout, but then // deleted the layout after page was already published. echo themeblvd_get_local('invalid_layout'); return; } // Gather elements and only move forward if we have elements to show. $elements = get_post_meta($layout_id, 'elements', true); if (!empty($elements) && !empty($elements[$location])) { $elements = $elements[$location]; $num_elements = count($elements); } else { // If there are no elements in this location, // get us out of here! return; } // Loop through elements foreach ($elements as $id => $element) { // Skip element if its type isn't registered if (!$api->is_element($element['type'])) { continue; } // Increase counter $counter++; // CSS classes for element $classes = 'element ' . $location . '-element-' . $counter . ' element-' . $element['type']; if ($counter == 1) { $classes .= ' first-element'; } if ($num_elements == $counter) { $classes .= ' last-element'; } if ($element['type'] == 'slider') { if (isset($element['options']['slider_id'])) { $slider_id = themeblvd_post_id_by_name($element['options']['slider_id'], 'tb_slider'); $type = get_post_meta($slider_id, 'type', true); $classes .= ' element-slider-' . $type; } } if ($element['type'] == 'paginated_post_lst' || $element['type'] == 'paginated_post_grid') { $classes .= $element['type']; } if (!empty($element['options']['classes'])) { $classes .= ' ' . $element['options']['classes']; } if (isset($element['options']['visibility'])) { $classes .= themeblvd_responsive_visibility_class($element['options']['visibility'], true); } $classes .= themeblvd_get_classes('element_' . $element['type'], true, false, $element['type'], $element['options'], $location); // Start ouput do_action('themeblvd_element_' . $element['type'] . '_before', $id, $element['options'], $location); // Before element: themeblvd_element_{type}_before do_action('themeblvd_element_open', $element['type'], $location, $classes); do_action('themeblvd_element_' . $element['type'] . '_top', $id, $element['options'], $location); // Top of element: themeblvd_element_{type}_top echo '<div class="grid-protection">'; switch ($element['type']) { /*------------------------------------------------------*/ /* Columns /*------------------------------------------------------*/ case 'columns': if (!function_exists('themeblvd_columns')) { _e('Columns element not supported.', 'themeblvd_builder'); break; } $i = 1; $columns = array(); $num = $element['options']['setup']['num']; while ($i <= $num) { $columns[] = $element['options']['col_' . $i]; $i++; } themeblvd_columns($num, $element['options']['setup']['width'][$num], $columns); break; /*------------------------------------------------------*/ /* Content /*------------------------------------------------------*/ /*------------------------------------------------------*/ /* Content /*------------------------------------------------------*/ case 'content': if (!function_exists('themeblvd_content')) { _e('Content element not supported.', 'themeblvd_builder'); break; } echo themeblvd_content($element['options']); break; /*------------------------------------------------------*/ /* Divider /*------------------------------------------------------*/ /*------------------------------------------------------*/ /* Divider /*------------------------------------------------------*/ case 'divider': if (!function_exists('themeblvd_divider')) { _e('Divider element not supported.', 'themeblvd_builder'); break; } echo themeblvd_divider($element['options']['type']); break; /*------------------------------------------------------*/ /* Headline /*------------------------------------------------------*/ /*------------------------------------------------------*/ /* Headline /*------------------------------------------------------*/ case 'headline': if (!function_exists('themeblvd_headline')) { _e('Headline element not supported.', 'themeblvd_builder'); break; } echo themeblvd_headline($element['options']); break; /*------------------------------------------------------*/ /* Jumbotron /*------------------------------------------------------*/ /*------------------------------------------------------*/ /* Jumbotron /*------------------------------------------------------*/ case 'jumbotron': if (!function_exists('themeblvd_jumbotron')) { _e('Jumbotron element not supported.', 'themeblvd_builder'); break; } themeblvd_jumbotron($element['options']); break; /*------------------------------------------------------*/ /* Post Grid /*------------------------------------------------------*/ /*------------------------------------------------------*/ /* Post Grid /*------------------------------------------------------*/ case 'post_grid': if (!function_exists('themeblvd_posts')) { _e('Post Grid element not supported.', 'themeblvd_builder'); break; } themeblvd_posts($element['options'], 'grid', $location, 'secondary'); break; /*------------------------------------------------------*/ /* Post Grid (paginated) /*------------------------------------------------------*/ /*------------------------------------------------------*/ /* Post Grid (paginated) /*------------------------------------------------------*/ case 'post_grid_paginated': if (!function_exists('themeblvd_posts_paginated')) { _e('Paginated Post Grid element not supported.', 'themeblvd_builder'); break; } if (!$primary_query) { themeblvd_posts_paginated($element['options'], 'grid', $location); $primary_query = true; } break; /*------------------------------------------------------*/ /* Post Grid Slider /*------------------------------------------------------*/ /*------------------------------------------------------*/ /* Post Grid Slider /*------------------------------------------------------*/ case 'post_grid_slider': if (!function_exists('themeblvd_post_slider')) { _e('Post Grid Slider element not supported.', 'themeblvd_builder'); break; } themeblvd_post_slider($id, $element['options'], 'grid', $location); break; /*------------------------------------------------------*/ /* Post List /*------------------------------------------------------*/ /*------------------------------------------------------*/ /* Post List /*------------------------------------------------------*/ case 'post_list': if (!function_exists('themeblvd_posts')) { _e('Post List element not supported.', 'themeblvd_builder'); break; } themeblvd_posts($element['options'], 'list', $location, 'secondary'); break; /*------------------------------------------------------*/ /* Post List (paginated) /*------------------------------------------------------*/ /*------------------------------------------------------*/ /* Post List (paginated) /*------------------------------------------------------*/ case 'post_list_paginated': if (!function_exists('themeblvd_posts_paginated')) { _e('Paginated Post List element not supported.', 'themeblvd_builder'); break; } if (!$primary_query) { themeblvd_posts_paginated($element['options'], 'list', $location); $primary_query = true; } break; /*------------------------------------------------------*/ /* Post List Slider /*------------------------------------------------------*/ /*------------------------------------------------------*/ /* Post List Slider /*------------------------------------------------------*/ case 'post_list_slider': if (!function_exists('themeblvd_post_slider')) { _e('Post List Slider element not supported.', 'themeblvd_builder'); break; } themeblvd_post_slider($id, $element['options'], 'list', $location); break; /*------------------------------------------------------*/ /* Post Slider (mimics standard slider) /*------------------------------------------------------*/ /*------------------------------------------------------*/ /* Post Slider (mimics standard slider) /*------------------------------------------------------*/ case 'post_slider': if (!function_exists('themeblvd_slider_auto')) { _e('Post Slider element not supported.', 'themeblvd_builder'); break; } themeblvd_slider_auto($id, $element['options']); break; /*------------------------------------------------------*/ /* Slider /*------------------------------------------------------*/ /*------------------------------------------------------*/ /* Slider /*------------------------------------------------------*/ case 'slider': if (!function_exists('themeblvd_slider')) { _e('Slider element not supported.', 'themeblvd_builder'); break; } themeblvd_slider($element['options']['slider_id']); break; /*------------------------------------------------------*/ /* Slogan /*------------------------------------------------------*/ /*------------------------------------------------------*/ /* Slogan /*------------------------------------------------------*/ case 'slogan': if (!function_exists('themeblvd_slogan')) { _e('Slogan element not supported.', 'themeblvd_builder'); break; } echo themeblvd_slogan($element['options']); break; /*------------------------------------------------------*/ /* Tabs /*------------------------------------------------------*/ /*------------------------------------------------------*/ /* Tabs /*------------------------------------------------------*/ case 'tabs': if (!function_exists('themeblvd_tabs')) { _e('Tabs element not supported.', 'themeblvd_builder'); break; } echo themeblvd_tabs($id, $element['options']); break; } // End switch // Allow to add on custom element that's // not in the framework do_action('themeblvd_' . $element['type'], $id, $element['options'], $location); // End output echo '<div class="clear"></div>'; echo '</div><!-- .grid-protection (end) -->'; do_action('themeblvd_element_' . $element['type'] . '_bottom', $id, $element['options'], $location); // Bottom of element: themeblvd_element_{type}_bottom do_action('themeblvd_element_close', $element['type'], $location, $classes); do_action('themeblvd_element_' . $element['type'] . '_after', $id, $element['options'], $location); // Below element: themeblvd_element_{type}_bottom } // End foreach }
echo $cat->cat_name; ?> </h3> <ul> <?php while (have_posts()) { the_post(); ?> <li><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a> - <?php echo themeblvd_get_local('comments'); ?> (<?php echo $post->comment_count; ?> )</li> <?php } wp_reset_query(); ?> </ul> <?php } ?> </div><!-- .entry-content (end) --> </article>
<?php } ?> <!-- COMMENTS (end) --> <?php } else { // No comments to show ?> <?php if (!comments_open() && !is_page()) { ?> <p class="nocomments"><?php echo themeblvd_get_local('comments_closed'); ?> </p> <?php } ?> <?php } ?> <!-- COMMENT FORM (start) --> <div class="comment-form-wrapper"> <div class="comment-form-inner"> <?php
/** * Take a piece of markup and wrap it in a link to a lightbox. * * @since 2.3.0 * * @param $args array Arguments for lightbox link * @return $output string Final HTML to output */ function themeblvd_get_link_to_lightbox($args) { $defaults = array('item' => themeblvd_get_local('link_to_lightbox'), 'link' => '', 'title' => '', 'type' => '', 'class' => '', 'props' => array(), 'addon' => '', 'gallery' => false); $args = wp_parse_args($args, $defaults); // Item markup to wrap link around $item = $args['item']; // Start building link properties $props = array('href' => $args['link'], 'title' => $args['title'], 'class' => ''); // Fix for youtu.be links if (strpos($props['href'], 'http://youtu.be/') !== false) { $props['href'] = str_replace('http://youtu.be/', 'http://youtube.com/watch?v=', $props['href']); } // Lightbox type $types = array('image', 'iframe', 'inline', 'ajax'); $type = $args['type']; if (!in_array($type, $types)) { // Auto lightbox type detection if (strpos($props['href'], 'youtube.com') !== false || strpos($props['href'], 'vimeo.com') !== false || strpos($props['href'], 'maps.google.com') !== false) { $type = 'iframe'; } else { if (strpos($props['href'], '#') === 0) { $type = 'inline'; } else { $parsed_url = parse_url($props['href']); $filetype = wp_check_filetype($parsed_url['path']); // Link to image file? if (substr($filetype['type'], 0, 5) == 'image') { $type = 'image'; } } } } // CSS classes $class = array('themeblvd-lightbox', "mfp-{$type}"); if ('iframe' == $type) { $class[] = 'lightbox-iframe'; // Enables framework's separate JS for iframe video handling in non-galleries } $user_class = $args['class']; if (!is_array($args['class'])) { $user_class = explode(' ', $args['class']); } $class = array_merge($class, $user_class); $class = apply_filters('themeblvd_lightbox_class', $class, $args, $type, $item); // Filter while still an array $props['class'] = implode(' ', $class); // Add user any additional properties passed in if (is_array($args['props'])) { $props = array_merge($props, $args['props']); } // Extend link properties $props = apply_filters('themeblvd_lightbox_props', $props, $args, $type, $item, $class); // Use properties array to build anchor tag $output = '<a '; foreach ($props as $key => $value) { $output .= "{$key}=\"{$value}\" "; } $output = themeblvd_remove_trailing_char($output, ' '); // Manual addon if ($args['addon']) { $output .= ' ' . $args['addon']; } // Finish link $output .= sprintf('>%s</a>', $item); return apply_filters('themeblvd_link_to_lightbox', $output, $args, $props, $type, $item, $class); }
/** * Display slider. * * @since 2.0.0 * * @param string $slider Slug of custom-built slider to use */ function themeblvd_slider($slider) { // Kill it if there's no slider if (!$slider) { printf('<div class="alert warning"><p>%s</p></div>', themeblvd_get_local('no_slider_selected.')); return; } // Get Slider ID $slider_id = themeblvd_post_id_by_name($slider, 'tb_slider'); if (!$slider_id) { echo themeblvd_get_local('no_slider'); return; } // Gather info $type = get_post_meta($slider_id, 'type', true); $settings = get_post_meta($slider_id, 'settings', true); $slides = get_post_meta($slider_id, 'slides', true); // Display slider based on its slider type do_action('themeblvd_' . $type . '_slider', $slider, $settings, $slides); }
<?php /** * The template used for displaying no search results in search.php */ ?> <div class="article-wrap"> <article> <div class="entry-content no-search-results"> <p><?php echo themeblvd_get_local('search_no_results'); ?> </p> <?php get_search_form(); ?> </div><!-- .entry-content --> </article> </div><!-- .article-wrap (end) -->
/** * Construct parts of a breadcrumbs trail as an array * to be used when displaying breadcrumbs. * * @since 2.2.1 * * @param string $atts Filtered attributes for breadcrumbs * @return array $breadcrumbs Breadcrumbs parts to display trail */ function themeblvd_get_breadcrumb_parts($atts) { global $post; global $wp_query; $breadcrumbs = array(); $parts = array(); wp_reset_query(); // Home $breadcrumbs[] = array('link' => $atts['home_link'], 'text' => $atts['home'], 'type' => 'home'); // Build parts if (is_category()) { /* Category Archives */ $cat_obj = $wp_query->get_queried_object(); $current_cat = $cat_obj->term_id; $current_cat = get_category($current_cat); if ($current_cat->parent && $current_cat->parent != $current_cat->term_id) { $parents = themeblvd_get_category_parents($current_cat->parent); if (is_array($parents)) { $parts = array_merge($parts, $parents); } } // Add current category $parts[] = array('link' => '', 'text' => $current_cat->name, 'type' => 'category'); } elseif (is_day()) { /* Day Archives */ // Year $parts[] = array('link' => get_year_link(get_the_time('Y')), 'text' => get_the_time('Y'), 'type' => 'year'); // Month $parts[] = array('link' => get_month_link(get_the_time('Y'), get_the_time('m')), 'text' => get_the_time('F'), 'type' => 'month'); // Day $parts[] = array('link' => '', 'text' => get_the_time('d'), 'type' => 'day'); } elseif (is_month()) { /* Month Archives */ // Year $parts[] = array('link' => get_year_link(get_the_time('Y')), 'text' => get_the_time('Y'), 'type' => 'year'); // Month $parts[] = array('link' => '', 'text' => get_the_time('F'), 'type' => 'month'); } elseif (is_year()) { /* Year Archives */ // Year $parts[] = array('link' => '', 'text' => get_the_time('Y'), 'type' => 'year'); } elseif (is_tag()) { /* Tag Archives */ $parts[] = array('link' => '', 'text' => themeblvd_get_local('crumb_tag') . ' "' . single_tag_title('', false) . '"', 'type' => 'tag'); } elseif (is_author()) { /* Author Archives */ global $author; $userdata = get_userdata($author); $parts[] = array('link' => '', 'text' => themeblvd_get_local('crumb_author') . ' ' . $userdata->display_name, 'type' => 'author'); } elseif (is_attachment()) { /* Attachment */ $parent = get_post($post->post_parent); if (!empty($parent)) { $category = get_the_category($parent->ID); if (!empty($category)) { $category = $category[0]; $parents = themeblvd_get_category_parents($category->term_id); if (is_array($parents)) { $parts = array_merge($parts, $parents); } } $parts[] = array('link' => get_permalink($parent->ID), 'text' => $parent->post_title, 'type' => 'single'); } $parts[] = array('link' => '', 'text' => get_the_title(), 'type' => 'attachment'); } elseif (is_single()) { /* Single Posts */ if (get_post_type() == 'post') { // Categories (only if standard post type) $category = get_the_category(); $category = $category[0]; $parents = themeblvd_get_category_parents($category->term_id); if (is_array($parents)) { $parts = array_merge($parts, $parents); } } $parts[] = array('link' => '', 'text' => get_the_title(), 'type' => 'single'); } elseif (is_search()) { /* Search Results */ $parts[] = array('link' => '', 'text' => themeblvd_get_local('crumb_search') . ' "' . get_search_query() . '"', 'type' => 'search'); } elseif (is_page()) { /* Pages */ if ($post->post_parent) { // Parent pages $parent_id = $post->post_parent; $parents = array(); while ($parent_id) { $page = get_page($parent_id); $parents[] = array('link' => get_permalink($page->ID), 'text' => get_the_title($page->ID), 'type' => 'page'); $parent_id = $page->post_parent; } $parents = array_reverse($parents); $parts = array_merge($parts, $parents); } $parts[] = array('link' => '', 'text' => get_the_title(), 'type' => 'page'); } elseif (is_404()) { /* 404 */ $parts[] = array('link' => '', 'text' => themeblvd_get_local('crumb_404'), 'type' => '404'); } // Filter the trail before the Home link is // added to the start, or the page num is // added to the end. $parts = apply_filters('themeblvd_pre_breadcrumb_parts', $parts, $atts); // Add page number if is paged if (get_query_var('paged')) { $last = count($parts) - 1; $parts[$last]['text'] .= ' (' . themeblvd_get_local('page') . ' ' . get_query_var('paged') . ')'; } // Final filter on entire breadcrumbs trail. $breadcrumbs = apply_filters('themeblvd_breadcrumb_parts', array_merge($breadcrumbs, $parts), $atts); return $breadcrumbs; }
"> <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) -->
?> <?php while (have_posts()) { the_post(); ?> <?php get_template_part('content', themeblvd_get_part('index')); ?> <?php } ?> <?php } else { ?> <p><?php echo themeblvd_get_local('archive_no_posts'); ?> </p> <?php } ?> <?php themeblvd_pagination(); ?> </div><!-- .blogroll (end) --> <!-- HOMEPAGE POST LIST (end) --> <?php } ?>
/** * Get Mini Post Grid * * @since 2.1.0 * * @param array $options Options for many post grid * @return string $output HTML to output */ function themeblvd_get_mini_post_grid($query = '', $align = 'left', $thumb = 'smaller', $gallery = '') { global $post; global $_wp_additional_image_sizes; $output = ''; // CSS classes $classes = $thumb . '-thumbs'; $classes .= ' grid-align-' . $align; if ($gallery) { $classes .= ' gallery-override themeblvd-gallery'; } // Thumb size $thumb_size = apply_filters('themeblvd_mini_post_grid_thumb_size', 'square_' . $thumb, $thumb, $query); $thumb_width = $_wp_additional_image_sizes[$thumb_size]['width']; // Check for gallery override $gallery_link = ''; if ($gallery) { $pattern = get_shortcode_regex(); if (preg_match("/{$pattern}/s", $gallery, $match) && 'gallery' == $match[2]) { $atts = shortcode_parse_atts($match[3]); if (isset($atts['link']) && 'file' == $atts['link']) { $gallery_link = 'file'; } if (!empty($atts['ids'])) { $query = array('post_type' => 'attachment', 'post__in' => explode(',', $atts['ids']), 'posts_per_page' => -1); } } } // Format query if (!is_array($query)) { $query = html_entity_decode($query); } // Get posts $posts = get_posts($query); // Start output if ($posts) { $output = '<div class="themeblvd-mini-post-grid">'; $output .= '<ul class="' . $classes . '">'; foreach ($posts as $post) { setup_postdata($post); $output .= '<li>'; if ($gallery) { // Gallery image output to simulate featured images $thumbnail = wp_get_attachment_image_src($post->ID, apply_filters('themeblvd_mini_post_grid_thumb_size', 'square_' . $thumb, $thumb, $query, $align, $gallery)); $output .= '<div class="featured-image-wrapper">'; $output .= '<div class="featured-image">'; $output .= '<div class="featured-image-inner">'; if ('file' == $gallery_link) { $image = wp_get_attachment_image_src($post->ID, 'full'); $item = sprintf('<img src="%s" alt="%s" />', $thumbnail[0], $post->post_title); $args = array('item' => $item . themeblvd_get_image_overlay(), 'link' => $image[0], 'title' => $post->post_title, 'class' => 'image thumbnail', 'gallery' => true); $output .= themeblvd_get_link_to_lightbox($args); } else { $output .= sprintf('<a href="%s" title="%s" class="image thumbnail">', get_permalink($post->ID), $post->post_title, $gallery); $output .= sprintf('<img src="%s" alt="%s" />', $thumbnail[0], $post->post_title); $output .= themeblvd_get_image_overlay(); $output .= '</a>'; } $output .= '</div><!-- .featured-image-inner (end) -->'; $output .= '</div><!-- .featured-image (end) -->'; $output .= '</div><!-- .featured-image-wrapper (end) -->'; } else { // Standard featured image output $image = themeblvd_get_post_thumbnail('primary', $thumb_size); // If post thumbnail isn't set, pull default thumbnail // based on post format. If theme doesn't support post // formats, format will always be "standard". if (!$image) { $default_img_directory = apply_filters('themeblvd_thumbnail_directory', get_template_directory_uri() . '/framework/assets/images/thumbs/2x/'); $post_format = get_post_format(); if (!$post_format) { $post_format = 'standard'; } $image .= '<div class="featured-image-wrapper attachment-' . $thumb_size . ' thumbnail">'; $image .= '<div class="featured-image">'; $image .= '<div class="featured-image-inner">'; $image .= sprintf('<a href="%s" title="%s">', get_permalink(), get_the_title()); $image .= sprintf('<img src="%s.png" width="%s" class="wp-post-image" />', $default_img_directory . $thumb . '_' . $post_format, $thumb_width); $image .= '</a>'; $image .= '</div><!-- .featured-image-inner (end) -->'; $image .= '</div><!-- .featured-image (end) -->'; $image .= '</div><!-- .featured-image-wrapper (end) -->'; } $output .= $image; } $output .= '</li>'; } wp_reset_postdata(); $output .= '</ul>'; $output .= '<div class="clear"></div>'; $output .= '</div><!-- .themeblvd-mini-post-list (end) -->'; } else { $output = themeblvd_get_local('archive_no_posts'); } return $output; }
/** * 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; }
/** * Get the final video output for a video slide * * @since 1.1.0 * * @param array $media_atts Media attributes from themeblvd_sliders_get_media_atts() * @param string $slider_type Type of slider, standard, nivo, carrousel, bootstrap, or fallback * @return string $video Embed code for video */ function themeblvd_sliders_get_video($media_atts, $slider_type = 'standard') { // This only should be used with videos. if ($media_atts['type'] != 'video') { return; } // Give a chance to override with custom video solution before // doing work of wp_oembed_get() $video = apply_filters('themeblvd_sliders_video_intervene', '', $media_atts); if ($video) { return $video; } // Is this an oEmbed? $type = wp_check_filetype($media_atts['video']); $oembed = true; $video_extensions = array('mp4', 'm4v', 'webm', 'ogv', 'wmv', 'flv'); // @todo With WP 3.6+, can use wp_get_video_extensions() if (in_array($type['ext'], $video_extensions)) { $oembed = false; } // Get HTML if ($oembed) { // oEmbed for external videos $video = wp_oembed_get($media_atts['video']); } else { // Self-hosted videos, supported in WP 3.6+ // @todo Improve this. Could be better with params from slider -- width, height, poster $video = do_shortcode(sprintf('[video src="%s"]', $media_atts['video'])); } // Append max height if ($video) { $video_max_height = ''; if (!empty($media_atts['height']) && intval($media_atts['height']) > 0) { $video_max_height = sprintf('max-height: %dpx;', $media_atts['height']); } $video_max_height = apply_filters('themeblvd_sliders_max_height', $video_max_height, $media_atts['height']); if ($video_max_height) { if ($oembed) { $find = '<div class="themeblvd-video-wrapper"'; $video = str_replace($find, $find . ' style="' . $video_max_height . '"', $video); } else { $id = uniqid('tb_video_'); $output = "<style>#{$id} .wp-video-shortcode { {$video_max_height} }</style>\n"; $output .= '<div id="' . $id . '">' . $video . '</div>'; $video = $output; } } } // Set error message if (!$video) { $video = '<p>' . themeblvd_get_local('no_video') . '</p>'; } return $video; }
?> <?php echo themeblvd_get_local('comments'); ?> </li> <?php } } wp_reset_query(); ?> </ul> <h2><?php echo themeblvd_get_local('categories'); ?> </h2> <ul> <?php wp_list_categories('title_li=&hierarchical=0&show_count=1'); ?> </ul> <h2><?php echo themeblvd_get_local('monthly_archives'); ?> </h2> <ul> <?php wp_get_archives('type=monthly&show_post_count=1'); ?> </ul> </div><!-- .entry-content (end) --> </article>
/** * 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; } }