?> <img src="<?php echo bd_post_image('large'); ?> " alt="<?php the_title(); ?> " title="<?php the_title(); ?> " /> <?php } elseif (strpos(bd_post_image(), 'dailymotion')) { ?> <img src="<?php echo bd_post_image('large'); ?> " alt="<?php the_title(); ?> " title="<?php the_title(); ?> " /> <?php } else { ?> <img src="<?php echo $ntImage; ?> " alt="<?php
function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', $instance['title']); $number = $instance['number']; $categories = $instance['categories']; ?> <div class="flexslider widgetslider" id="<?php echo $args['widget_id']; ?> "> <ul class="slides"> <?php global $post; $recent = new WP_Query(array('cat' => $categories, 'showposts' => $number)); while ($recent->have_posts()) { $recent->the_post(); ?> <li> <a href="<?php the_permalink(); ?> " title="<?php printf(esc_attr__('Permalink to %s', 'bd'), the_title_attribute('echo=0')); ?> " rel="bookmark"> <?php $thumb = bd_post_image('large'); $ntImage = aq_resize($thumb, 298, 215, true); if ($ntImage == '') { $ntImage = BD_IMG . '/default_thumb.png'; } ?> <?php if (strpos(bd_post_image(), 'youtube')) { ?> <img class="youtube-img" src="<?php echo bd_post_image('large'); ?> " width="298" height="215" alt="<?php the_title(); ?> " title="<?php the_title(); ?> " /> <?php } elseif (strpos(bd_post_image(), 'vimeo')) { ?> <img class="vimeo-img" src="<?php echo bd_post_image('large'); ?> " width="298" height="215" alt="<?php the_title(); ?> " title="<?php the_title(); ?> " /> <?php } elseif (strpos(bd_post_image(), 'dailymotion')) { ?> <img class="dailymotion-img" src="<?php echo bd_post_image('large'); ?> " width="298" height="215" alt="<?php the_title(); ?> " title="<?php the_title(); ?> " /> <?php } else { ?> <img class="ntImage-img" src="<?php echo $ntImage; ?> " alt="<?php the_title(); ?> " title="<?php the_title(); ?> " /> <?php } ?> </a> <div class="slider-caption"> <a href="<?php the_permalink(); ?> " title="<?php printf(esc_attr__('Permalink to %s', 'bd'), the_title_attribute('echo=0')); ?> " rel="bookmark"><?php the_title(); ?> </a> </div> </li> <?php } ?> </ul> </div> <script> jQuery(window).load(function() { jQuery('#<?php echo $args['widget_id']; ?> ').flexslider({ animation: "fade", slideshowSpeed: 7000, animationSpeed: 600, randomize: false, pauseOnHover: true, controlNav: false }); }); </script> <div class="clear"></div> <?php }
<li class="posts-list-small"> <div class="inner_post"> <?php $img_w = 55; $img_h = 55; $thumb = bd_post_image('full'); $image = aq_resize($thumb, $img_w, $img_h, true); $alt = get_the_title(); $link = get_permalink(); if (strpos(bd_post_image(), 'youtube')) { echo '<div class="post_thumbnail"><a href="' . $link . '" title="' . $alt . '"><img src="' . bd_post_image('full') . '" width="' . $img_w . '" height="' . $img_h . '" alt="' . $alt . '" /></a></div><!-- .post-image/-->' . "\n"; } elseif (strpos(bd_post_image(), 'vimeo')) { echo '<div class="post_thumbnail"><a href="' . $link . '" title="' . $alt . '"><img src="' . bd_post_image('full') . '" width="' . $img_w . '" height="' . $img_h . '" alt="' . $alt . '" /></a></div><!-- .post-image/-->' . "\n"; } elseif (strpos(bd_post_image(), 'dailymotion')) { echo '<div class="post_thumbnail"><a href="' . $link . '" title="' . $alt . '"><img src="' . bd_post_image('full') . '" width="' . $img_w . '" height="' . $img_h . '" alt="' . $alt . '" /></a></div><!-- .post-image/-->' . "\n"; } else { if ($image) { echo '<div class="post_thumbnail"><a href="' . $link . '" title="' . $alt . '"><img src="' . $image . '" width="' . $img_w . '" height="' . $img_h . '" alt="' . $alt . '" /></a></div><!-- .post-image/-->' . "\n"; } } ?> <h2> <a href="<?php the_permalink(); ?> " title="<?php printf(esc_attr__('%s', 'bd'), the_title_attribute('echo=0')); ?> " rel="author">
/** * * Recent * */ function cherry_last_posts($numberOfPosts = 5, $thumb = true) { global $post; $orig_post = $post; $lastPosts = get_posts('numberposts=' . $numberOfPosts); foreach ($lastPosts as $post) { setup_postdata($post); ?> <li> <?php $img_w = 55; $img_h = 55; $thumb = bd_post_image('full'); $image = aq_resize($thumb, $img_w, $img_h, true); $alt = get_the_title(); $link = get_permalink(); if (strpos(bd_post_image(), 'youtube')) { echo '<div class="post_thumbnail"><a href="' . $link . '" title="' . $alt . '"><img src="' . bd_post_image('full') . '" width="' . $img_w . '" height="' . $img_h . '" alt="' . $alt . '" /></a></div><!-- .post-image/-->' . "\n"; } elseif (strpos(bd_post_image(), 'vimeo')) { echo '<div class="post_thumbnail"><a href="' . $link . '" title="' . $alt . '"><img src="' . bd_post_image('full') . '" width="' . $img_w . '" height="' . $img_h . '" alt="' . $alt . '" /></a></div><!-- .post-image/-->' . "\n"; } elseif (strpos(bd_post_image(), 'dailymotion')) { echo '<div class="post_thumbnail"><a href="' . $link . '" title="' . $alt . '"><img src="' . bd_post_image('full') . '" width="' . $img_w . '" height="' . $img_h . '" alt="' . $alt . '" /></a></div><!-- .post-image/-->' . "\n"; } else { if ($image) { echo '<div class="post_thumbnail"><a href="' . $link . '" title="' . $alt . '"><img src="' . $image . '" width="' . $img_w . '" height="' . $img_h . '" alt="' . $alt . '" /></a></div><!-- .post-image/-->' . "\n"; } } ?> <h3><a href="<?php the_permalink(); ?> " title="<?php printf(esc_attr__('%s', 'bd'), the_title_attribute('echo=0')); ?> " rel="bookmark"><?php the_title(); ?> </a></h3> <span class="date"><?php the_time(get_option('date_format')); ?> </span> <span class="post-rat"><?php echo bd_wp_post_rate(); ?> </span> </li> <?php } $post = $orig_post; }
function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', $instance['title']); $number = $instance['number']; $categories = $instance['categories']; echo $before_widget; if ($title) { echo $before_title . $title . $after_title; } ?> <ul> <?php global $post; $recent = new WP_Query(array('cat' => $categories, 'showposts' => $number)); while ($recent->have_posts()) { $recent->the_post(); ?> <li> <?php $img_w = 55; $img_h = 55; $thumb = bd_post_image('full'); $image = aq_resize($thumb, $img_w, $img_h, true); $alt = get_the_title(); $link = get_permalink(); if (strpos(bd_post_image(), 'youtube')) { echo '<div class="post_thumbnail"><a href="' . $link . '" title="' . $alt . '"><img src="' . bd_post_image('full') . '" width="' . $img_w . '" height="' . $img_h . '" alt="' . $alt . '" /></a></div><!-- .post-image/-->' . "\n"; } elseif (strpos(bd_post_image(), 'vimeo')) { echo '<div class="post_thumbnail"><a href="' . $link . '" title="' . $alt . '"><img src="' . bd_post_image('full') . '" width="' . $img_w . '" height="' . $img_h . '" alt="' . $alt . '" /></a></div><!-- .post-image/-->' . "\n"; } elseif (strpos(bd_post_image(), 'dailymotion')) { echo '<div class="post_thumbnail"><a href="' . $link . '" title="' . $alt . '"><img src="' . bd_post_image('full') . '" width="' . $img_w . '" height="' . $img_h . '" alt="' . $alt . '" /></a></div><!-- .post-image/-->' . "\n"; } else { if ($image) { echo '<div class="post_thumbnail"><a href="' . $link . '" title="' . $alt . '"><img src="' . $image . '" width="' . $img_w . '" height="' . $img_h . '" alt="' . $alt . '" /></a></div><!-- .post-image/-->' . "\n"; } } ?> <h3><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h3> <span class="date"><?php the_time(get_option('date_format')); ?> </span> <span class="post-rat"><?php echo bd_wp_post_rate(); ?> </span> </li> <?php } ?> </ul> <div class="clear"></div> <?php echo $after_widget; }
function widget($args, $instance) { extract($args); if (is_single()) { $title = apply_filters('widget_title', $instance['title']); $number = $instance['number']; echo $before_widget; if ($title) { echo $before_title . $title . $after_title; } ?> <ul> <?php global $post; $cats = get_the_category($post->ID); if ($cats) { $cat_ids = array(); foreach ($cats as $individual_cat) { $cat_ids[] = $individual_cat->cat_ID; } $args = array('category__in' => $cat_ids, 'post__not_in' => array($post->ID), 'showposts' => $number, 'ignore_sticky_posts' => 1); query_posts($args); ?> <?php while (have_posts()) { the_post(); ?> <li> <?php $thumb = bd_post_image('large'); $ntImage = aq_resize($thumb, 67, 67, true); ?> <?php if (strpos(bd_post_image(), 'youtube')) { ?> <div class="post_thumbnail"> <a href="<?php the_permalink(); ?> " title="<?php printf(esc_attr__('%s', 'bd'), the_title_attribute('echo=0')); ?> " rel="bookmark"> <img class="youtube-img" src="<?php echo bd_post_image('large'); ?> " width="67" height="67" alt="<?php the_title(); ?> " title="<?php the_title(); ?> " /> </a> </div><!-- thumbnail/--> <?php } elseif (strpos(bd_post_image(), 'vimeo')) { ?> <div class="post_thumbnail"> <a href="<?php the_permalink(); ?> " title="<?php printf(esc_attr__('%s', 'bd'), the_title_attribute('echo=0')); ?> " rel="bookmark"> <img class="vimeo-img" src="<?php echo bd_post_image('large'); ?> " width="67" height="67" alt="<?php the_title(); ?> " title="<?php the_title(); ?> " /> </a> </div><!-- thumbnail/--> <?php } elseif (strpos(bd_post_image(), 'dailymotion')) { ?> <div class="post_thumbnail"> <a href="<?php the_permalink(); ?> " title="<?php printf(esc_attr__('%s', 'bd'), the_title_attribute('echo=0')); ?> " rel="bookmark"> <img class="dailymotion-img" src="<?php echo bd_post_image('large'); ?> " width="67" height="67" alt="<?php the_title(); ?> " title="<?php the_title(); ?> " /> </a> </div><!-- thumbnail/--> <?php } else { if ($ntImage != '') { ?> <div class="post_thumbnail"> <a href="<?php the_permalink(); ?> " title="<?php printf(esc_attr__('%s', 'bd'), the_title_attribute('echo=0')); ?> " rel="bookmark"> <img class="ntImage-img" src="<?php echo $ntImage; ?> " alt="<?php the_title(); ?> " title="<?php the_title(); ?> " /> </a> </div><!-- thumbnail/--> <?php } } ?> <h3><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h3> <span class="date"><?php the_time(get_option('date_format')); ?> </span> </li> <?php } } ?> <?php wp_reset_query(); ?> </ul> <div class="clear"></div> <?php echo $after_widget; } }