function display_timeline($args) { $post_args = array('post_type' => get_option('timeline_post_type'), 'numberposts' => get_option('timeline_show_posts'), 'category' => get_option('timeline_post_category'), 'orderby' => 'post_date', 'order' => get_option('timeline_order_posts'), 'post_status' => 'publish', 'post_link' => get_option('timeline_post_link')); $posts = get_posts($post_args); $out .= '<div id="timeline">'; $out .= '<ul>'; foreach ($posts as $post) { setup_postdata($post); $out .= '<li><div>'; if (get_option('timeline_post_link') == 'yes') { $out .= '<span><h4 class="timeline-date">'; $out .= get_the_time(get_option('timeline_date_format'), $post->ID); $out .= '</h4></span>'; $out .= '<a href="' . get_permalink($post->ID) . '" title="' . $post->title . '"><h3 class="timeline-date">'; if (get_option('timeline_show_titles') == 'yes') { $out .= " " . get_the_title($post->ID) . " "; } $out .= '</h3></a>'; } else { $out .= '<span><h3 class="timeline-date">'; $out .= get_the_time(apply_filters('timeline_date_format', get_option('timeline_date_format')), $post->ID); if (get_option('timeline_show_titles') == 'yes') { $out .= " " . get_the_title($post->ID) . " "; } $out .= '</h3><span>'; } if (get_option('timeline_include_images') == 'yes') { if (featured_image() == true && has_post_thumbnail($post->ID)) { $out .= '<span class="timeline-image">' . get_the_post_thumbnail($post->ID, 'timeline-thumb') . '</span>'; } } $out .= '<span class="timeline-text">' . timeline_text(get_option('timeline_text_length')) . '</span>'; $out .= '<span class="timeline-text"><h6>' . tags_text(wp_get_post_tags($post->ID)) . '</h6></span>'; $out .= '</div></li>'; } $out .= '</ul>'; $out .= '</div> <!-- #timeline -->'; wp_reset_postdata(); return $out; }
function gallery_isotope_shortcode_handler($atts, $content = '') { $output = ''; $terms = get_terms('galleria-cat'); $output .= '<div class="gallery">'; $output .= '<div class="gallery-cat text-center">'; $output .= '<ul class="list-inline">'; $output .= '<li><a class="active" href="#" data-filter="*">All</a></li>'; foreach ($terms as $term) { $output .= '<li><a href="#" data-filter=".' . $term->slug . '">' . $term->name . '</a></li>'; } $output .= '</ul>'; $output .= '</div>'; $q = get_posts(array('post_type' => 'galleria', 'showposts' => -1)); $output .= '<div class="gallery-content">'; $output .= '<div class="grid gallery-grid">'; foreach ($q as $i => $t) { $terms = wp_get_post_terms($t->ID, 'galleria-cat', array('fields' => 'slugs')); $image = featured_image($t->ID, 'gallery-thumbnail'); $output .= '<div class="grid-item ' . implode(' ', $terms) . '"><img src="' . $image . '" /></div>'; } $output .= '</div>'; $output .= '</div>'; $output .= '</div>'; return $output; }
function get_portfolio_grid_image($item) { global $portfolio, $post, $msd_portfolio_url; $portfolio->the_meta($item->ID); $youtube = $portfolio->get_the_value('youtube'); if ($youtube != '') { if (class_exists('MultiPostThumbnails') && ($post_thumbnail_id = MultiPostThumbnails::get_post_thumbnail_id('msd_portfolio', 'grid-image', $item->ID))) { $featured_image = wp_get_attachment_image_src($post_thumbnail_id, 'portfolio', false, $attr); $featured_image = $featured_image[0]; } else { preg_match('/^.*(youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|\\&v=)([^#\\&\\?]*).*/i', $youtube, $matches); $videoid = $matches[2]; $featured_image = 'http://img.youtube.com/vi/' . $videoid . '/0.jpg'; } } else { if (class_exists('MultiPostThumbnails') && ($post_thumbnail_id = MultiPostThumbnails::get_post_thumbnail_id('msd_portfolio', 'grid-image', $item->ID))) { $featured_image = wp_get_attachment_image_src($post_thumbnail_id, 'portfolio', false, $attr); $featured_image = $featured_image[0]; } else { $featured_image = featured_image($item->ID, 'portfolio'); $featured_image = $featured_image[0]; } } return $featured_image; }
public function details() { if (defined('DOING_AJAX') && DOING_AJAX) { $details = get_booking_by_id(browser_get('bid')); $details['featured_image'] = featured_image($details['room_type_ID'], 'large'); include_view('booking-details.html.php', $details); exit; } }
echo $index = $wp_query->current_post + 1; ?> "> <h2><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <div class="img"> <a href="<?php the_permalink(); ?> "><img src="<?php echo featured_image(get_the_ID(), 'gallery-post-thumbnails'); ?> " alt=""></a> </div> <div class="desc"> <p><?php echo wp_trim_words(get_the_content(), 20); ?> </p> <ul> <li><i class="fa fa-male"></i>Max: <?php the_field('max_person'); ?> Person(s)</li> <li><i class="fa fa-bed"></i>Bed: <?php the_field('bed');