function widget($args, $instance) { $cache = wp_cache_get('widget_single_image', 'widget'); if (!is_array($cache)) { $cache = array(); } if (!isset($args['widget_id'])) { $args['widget_id'] = $this->id; } if (isset($cache[$args['widget_id']])) { echo $cache[$args['widget_id']]; return; } ob_start(); extract($args); $cb_title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base); $cb_image = apply_filters('widget_title', empty($instance['imgurl']) ? '' : $instance['imgurl'], $instance, $this->id_base); $cb_retina_image = apply_filters('widget_title', empty($instance['retimgurl']) ? '' : $instance['retimgurl'], $instance, $this->id_base); echo $before_widget; if ($cb_title) { echo $before_title . $cb_title . $after_title; } if ($cb_image != NULL) { $cb_img_src = wp_get_attachment_image_src(cb_get_image_id($cb_image), 'full'); $cb_image_size = 'width="' . $cb_img_src[1] . '" height="' . $cb_img_src[2] . '"'; echo '<img src="' . $cb_image . '" alt=" " ' . $cb_image_size; if ($cb_retina_image != NULL) { echo ' data-retina-src="' . $cb_retina_image . '"'; } echo ' />'; } echo $after_widget; // Reset the global $the_post as this query will have stomped on it wp_reset_postdata(); $cache[$args['widget_id']] = ob_get_flush(); wp_cache_set('widget_single_image', $cache, 'widget'); }
echo 'itemprop="review" itemscope itemtype="http://schema.org/Review"'; } ?> > <header class="header clearfix<?php if ($cb_theme_style == 'cb_boxed') { echo ' wrap'; } ?> " role="banner"> <div class="wrap clearfix"> <?php if ($cb_logo != false) { $cb_logo_src = wp_get_attachment_image_src(cb_get_image_id($cb_logo), 'full'); $cb_logo_size = 'width="' . $cb_logo_src[1] . '" height="' . $cb_logo_src[2] . '"'; $cb_logo_retina = substr($cb_logo, 0, -4); $cb_logo_retina_ext = substr($cb_logo, -4); ?> <div id="logo" <?php if ($cb_banner == 'cb_banner_728') { echo 'class="cb-with-large"'; } ?> > <a href="<?php echo home_url(); ?> "> <img src="<?php
function cb_get_logo() { $cb_logo_url = ot_get_option('cb_logo_url', NULL); $cb_logo_retina = ot_get_option('cb_logo_url_retina', NULL); $cb_nav_logo_url = ot_get_option('cb_sticky_menu_logo', NULL); $cb_nav_logo_url_retina = ot_get_option('cb_sticky_menu_logo_retina', NULL); $cb_output = NULL; if ($cb_logo_retina != NULL) { $cb_logo_retina = 'data-retina-src="' . esc_url($cb_logo_retina) . '"'; } if ($cb_nav_logo_url_retina != NULL) { $cb_nav_logo_url_retina = 'data-retina-src="' . esc_url($cb_nav_logo_url_retina) . '"'; } if ($cb_logo_url != NULL) { $cb_logo_src = wp_get_attachment_image_src(cb_get_image_id($cb_logo_url), 'full'); $cb_logo_size = 'width="' . $cb_logo_src[1] . '" height="' . $cb_logo_src[2] . '"'; $cb_output = '<a href="' . esc_url(get_home_url()) . '" class="cb-logo-img"><img src="' . esc_url($cb_logo_src[0]) . '" alt="' . get_bloginfo('name') . ' logo" ' . $cb_logo_size . ' ' . $cb_logo_retina . '></a>'; } if ($cb_nav_logo_url != NULL) { $cb_logo_src = wp_get_attachment_image_src(cb_get_image_id($cb_nav_logo_url), 'full'); $cb_logo_size = 'width="' . $cb_logo_src[1] . '" height="' . $cb_logo_src[2] . '"'; $cb_output .= '<a href="' . esc_url(get_home_url()) . '" class="cb-nav-logo-img"><img src="' . esc_url($cb_logo_src[0]) . '" alt="' . get_bloginfo('name') . ' logo" ' . $cb_logo_size . ' ' . $cb_nav_logo_url_retina . '></a>'; } return $cb_output; }