$port_client = get_post_meta($post->ID, 'cb4_port_client', 'true'); $port_author = get_post_meta($post->ID, 'cb4_port_author', 'true'); $port_key = get_post_meta($post->ID, 'cb4_port_key', 'true'); if ($port_author != '') { echo '<h3 class="author titles">by: ' . $port_author . '</h3>'; } echo '<ul>'; if ($port_client != '') { echo '<li><h3 class="titles">' . __('Project Client') . ':</h3>' . $port_client . '</li>'; } if ($port_key != '') { echo '<li><h3 class="titles">' . __('Keywords') . ':</h3><i>' . $port_key . '</i></li>'; } echo '</ul>'; echo '<h3 class="titles">Project Details:</h3>'; echo strip_cn(get_the_content(), 320); if ($port_url != '') { echo '<div class="view_project"><a href="' . $port_url . '" target="_blank" class="bttn_big very alt"><i class="icon-external-link"></i>' . __('view project', 'cb-getrends') . '</a></div>'; } echo '<div class="port_arrows"><a class="cb-next-porfolio prev-arrow" data-me-id="' . $post->ID . '" data-action="prev">« ' . __('previous item', 'cb-getrends') . '</a><a class="cb-next-porfolio next-arrow" data-me-id="' . $post->ID . '" data-action="next">' . __('next item', 'cb-getrends') . ' »</a></div>'; ?> </div> <div class="c_item c_item_<?php echo $post->ID; ?> " style="display: none;"> <a href="#" class="prev_item">« <?php _e('prev item', 'cb-getrends');
function hottest($atts, $content = null) { esc_attr(extract(shortcode_atts(array('title' => '', 'rcat' => '0', 'show_nb' => '10'), $atts))); $args = array('post_type' => array('post', 'page'), 'posts_per_page' => '1', 'orderby' => 'meta_value', 'cat' => $rcat, 'meta_key' => 'cb_vote_nb_vote', 'meta_query' => array(array('key' => 'cb_vote_allow', 'value' => 'yes'), array('key' => 'cb_vote_nb_vote'))); query_posts($args); if (have_posts()) { ob_start(); ?> <?php $titty = ''; if (strlen($title) > 2) { $titty = '<h3>' . $title . '</h3>'; } echo '<div class="hottest_content">' . $titty; while (have_posts()) { the_post(); $isrc = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'full'); $nb_vote = esc_attr(get_post_meta(get_the_ID(), 'cb_vote_nb_vote', true)); echo '<div class="frame fade"><div class="frame_in"> <div class="fade_c"> <div class="see_more_wrap"><div class="see_wrap2"><a href="' . $isrc[0] . '" data-rel="pp"><span class="arr_wrap"><img src="' . WP_THEME_URL . '/img/icons/arr_r.png" class="fade-s fade_arr_r" alt="' . __('see more', 'cb-getrends') . '"/></span><h1><span class="fade_see">' . __('see more', 'cb-getrends') . '</span></h1></a></div></div><div class="cl"></div> </div> <a href="' . $isrc[0] . '" data-rel="pp"><img src="' . bfi_thumb($isrc[0], array('width' => '920', 'crop' => true)) . '" alt="gallery"/> </a></div></div>'; echo '<div class="hottest_data"> <div class="hottest_vote"><h3 class="first_post">1<sup>st</sup><span class="votenb">' . $nb_vote . ' Votes<span class="arrv"></span></span></h3></div><h3><a href="' . get_permalink() . '">' . get_the_title() . '</a></h3>' . strip_cn(get_the_content(), 300) . '</div>'; } echo '</div>'; // Reset Query wp_reset_query(); $return_html = ob_get_contents(); ob_end_clean(); } return apply_filters('hottest', $return_html); }
function cb_loader_code() { check_ajax_referer('dayandnight-settings', 'security'); $data = $_POST; unset($data['security'], $data['action']); if (isset($data['cats'])) { $cats = $data['cats']; } if (isset($data['typ'])) { $typ = $data['typ']; } else { $typ = 'port'; } if (isset($data['con_lg'])) { $con_lg = $data['con_lg']; } else { $con_lg = '100'; } if (isset($data['per_page'])) { $per_page = $data['per_page']; } if (isset($data['paged'])) { $paged = $data['paged']; } if (isset($data['col_v'])) { $col_v = $data['col_v']; } if (isset($data['columns'])) { $columns = $data['columns']; } if (isset($data['pcap'])) { $pcap = $data['pcap']; } if (isset($data['headi'])) { $headi = $data['headi']; } if (isset($data['headi_end'])) { $headi_end = $data['headi_end']; } if (isset($data['plink'])) { $plink = $data['plink']; } if (isset($data['pshape'])) { $pshape = $data['pshape']; } if (isset($data['fr'])) { $fr = $data['fr']; } if (isset($data['frin'])) { $frin = $data['frin']; } if (isset($data['pheight'])) { $pheight = $data['pheight']; } if (isset($data['roundy'])) { $roundy = $data['roundy']; } if (isset($data['bfi_w'])) { $bfi_w = $data['bfi_w']; } else { $bfi_w = ''; } if (isset($data['det'])) { $det = $data['det']; } else { $det = 'no'; } ob_start(); ?> <div class="<?php if ($typ == 'blog') { echo 'blog_els'; } else { echo 'port_els'; } ?> "> <?php $cc = 1; query_posts('cat=' . $cats . '&posts_per_page=' . $per_page . '&paged=' . $paged); if (have_posts()) { while (have_posts()) { the_post(); ?> <?php global $post; $output = ''; $ccat = ''; $c_cat = get_the_category(); foreach ($c_cat as $c_cat_item) { $output .= ' cat-' . $c_cat_item->term_id; $ccat .= $c_cat_item->term_id; } $headi = str_replace('/', '', $headi); ?> <div class="<?php if ($typ == 'blog') { echo 'postbox blog_item post-cat'; } else { echo 'pitem'; } ?> <?php echo $col_v; ?> <?php echo $output; ?> " data-id="<?php echo $ccat; ?> " style="<?php if ($columns != 1 && $cc % $columns == 0 && $cc != 0) { echo 'margin-right: 0;'; } ?> "> <?php if ($typ == 'blog') { ?> <div class="<?php if (has_post_format('quote')) { echo 'post_quote'; } if (has_post_format('link')) { echo 'post_link'; } if (has_post_format('gallery')) { echo 'post_gallery'; } ?> ddd blog_inside_post"> <?php } ?> <?php $isrc = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full'); $imgs = get_children('post_type=attachment&post_mime_type=image&post_parent=' . $post->ID); if ($isrc == '') { $isrc = wp_get_attachment_image_src(array_shift(array_keys($imgs)), 'full'); } $bfi_var = ''; if ($pshape == '' || $pshape == 'rectangle' || $pshape == 'default') { $bfi_var = bfi_thumb($isrc[0], array('width' => $bfi_w, 'height' => $bfi_w, 'crop' => true)); } else { $bfi_var = bfi_thumb($isrc[0], array('width' => $bfi_w, 'height' => $bfi_w, 'crop' => true)); } $pshapediv = ''; $pshapecon = ''; if ($pcap == 'yes') { $nocap = ''; } else { $nocap = ' nocap'; } if ($pcap == 'yes') { $pcapy = ''; } else { $pcapy = ''; } $see_more = __('see more', 'cb-getrends'); if ($plink == 'ajax') { $picons = '<div class="see_more_wrap"><div class="see_wrap2"><a data-cur-id="' . $post->ID . '" onclick="load_image(\'' . $isrc[0] . '\',\'' . $post->ID . '\');return false;" href="' . $isrc[0] . '"><span class="arr_wrap"><img src="' . WP_THEME_URL . '/img/icons/arr_r.png" class="fade-s fade_arr_r" alt="' . $see_more . '"/></span><h1><span class="fade_see">' . $see_more . '</span></h1></a></div></div><div class="cl"></div>'; } else { $picons = '<div class="see_more_wrap"><div class="see_wrap2"><a href="' . $isrc[0] . '" data-rel="pp[ppgall]"><span class="arr_wrap"><img src="' . WP_THEME_URL . '/img/icons/arr_r.png" class="fade-s fade_arr_r" alt="' . $see_more . '"/></span><h1><span class="fade_see">' . $see_more . '</span></h1></a></div></div><div class="cl"></div>'; } if ($plink == 'page') { $picons = '<div class="see_more_wrap"><div class="see_wrap2"><a href="' . get_permalink() . '"><span class="arr_wrap"><img src="' . WP_THEME_URL . '/img/icons/arr_r.png" class="fade-s fade_arr_r" alt="' . $see_more . '"/></span><h1><span class="fade_see">' . $see_more . '</span></h1></a></div></div><div class="cl"></div>'; } if ($pshape != '' && $pshape != 'default' && $pshape != 'rectangle') { $pshapediv = '<div class="pshape-' . $pshape . '"></div>'; $fadec1 = ''; $fadec2 = '<div class="fade_c">' . $picons . $pcapy . '</div>'; $pshapecon = 'portfolio-shape' . $nocap; } else { $pshapediv = ''; $fadec1 = '<div class="fade_c">' . $pcapy . $picons . '</div>'; $fadec2 = ''; $pshapecon = ''; } if ($isrc) { ?> <div class="<?php echo $fr; ?> <?php echo $roundy; ?> fade fade_ajax <?php echo $pshapecon; ?> "> <div class="<?php echo $frin; ?> <?php echo $roundy; ?> "> <?php echo $fadec1; ?> <?php echo $pshapediv . $fadec2; ?> <a <?php if ($plink == 'ajax') { ?> data-cur-id="<?php echo $post->ID; ?> " onclick="load_image('<?php echo $isrc[0]; ?> ','<?php echo $post->ID; ?> ');return false;" <?php } ?> href="<?php if ($plink == 'page') { echo get_permalink(); } else { echo $isrc[0]; } ?> " <?php if ($plink == 'image') { echo 'data-rel="pp"'; } ?> ><img src="<?php echo $bfi_var; ?> " class="<?php echo $roundy; ?> fade fade_ajax" alt="portfolio item" /> </a> <div class="cl"></div> </div> <?php if ($typ == 'blog') { ?> <div class="titlo"> <?php $cb_get_votes = check_votes($post->ID); $vot = $cb_get_votes['votes']; $voty = '<span class="vote">' . __('Votes', 'cb-getrends') . ': ' . $vot . '</span>'; if ($cb_get_votes['state'] == '0') { $voty = ''; } $datee = ' <h3 class="date_title skin-text">' . $voty . '<a href="' . get_author_posts_url(get_the_author_meta('ID')) . '" class="author_link">' . get_avatar(get_the_author_meta('ID'), 32) . get_the_author() . '</a> <i class="icon-time"></i> ' . get_the_time('M') . ' ' . get_the_time('j') . ', ' . get_the_time('Y') . '</h3>'; if ($coll != '1') { echo $headi . '<a href="' . get_permalink() . '">' . get_the_title() . '</a>' . $headi_end; } else { echo '<h1 class="mbimp blog_title"><a href="' . get_permalink() . '">' . get_the_title() . '</a></h1>'; } if ($coll != '1') { echo $datee; } else { echo ' <h3 class="date_title skin-text"><a href="' . get_author_posts_url(get_the_author_meta('ID')) . '" class="author_link">' . get_avatar(get_the_author_meta('ID'), 32) . get_the_author() . '</a> <i class="icon-time"></i> ' . get_the_time('M') . ' ' . get_the_time('j') . ', ' . get_the_time('Y') . ''; $tags = ''; $posttags = get_the_tags(); if ($posttags) { foreach ($posttags as $tag) { if ($tag->name != '') { $tags .= '<a href="' . get_tag_link($tag->term_id) . '">' . $tag->name . '</a> '; } } } if ($tags != '') { echo '<span class="tags"><i class="icon-tags"></i> ' . $tags . '</span>'; $tags = ''; } echo '<span class="comments"><i class="icon-comments"></i> '; echo comments_number('0 Comments', '1 Comments', '% Comments'); echo '</span>'; $categories = get_the_category(); $output = ''; echo '<span class="cats">'; foreach ($categories as $category) { $output .= '<a href="' . get_category_link($category->term_id) . '" title="' . esc_attr(sprintf(__("View all posts in %s", 'cb-getrends'), $category->name)) . '">' . $category->cat_name . '</a>, '; } echo '<i class="icon-folder-open"></i> Posted in: ' . substr(trim($output), 0, -1) . '</span>'; echo '</h3>'; } ?> </div><?php } ?> <?php if ($det == 'yes' || $typ == 'blog') { $pcatso = ''; if ($typ == 'blog') { echo '<div class="recent_inside">'; } else { echo '<div class="portfolio_det">'; } $categoriesy = wp_get_post_categories($post->ID); foreach ($categoriesy as $cate) { $category = get_category($cate); $pcatso .= '<a href="' . get_category_link($category->term_id) . '" class="skin-text" title="' . esc_attr(sprintf(__("View all posts in %s", 'cb-getrends'), $category->name)) . '">' . $category->cat_name . '</a>, '; } $pcatso = substr($pcatso, 0, -2); if ($typ != blog) { echo $headi . '<a href="' . get_permalink() . '">' . get_the_title() . '</a>' . $headi_end; if ($typ == 'blog') { echo ' <h3 class="date_title skin-text"><a href="' . get_author_posts_url(get_the_author_meta('ID')) . '" class="author_link">' . get_avatar(get_the_author_meta('ID'), 32) . get_the_author() . '</a> <i class="icon-time"></i> ' . get_the_time('M') . ' ' . get_the_time('j') . ', ' . get_the_time('Y') . ''; echo '</h3>'; } else { echo '<span class="port_author skin-text">by: <a href="' . get_author_posts_url(get_the_author_meta('ID')) . '" class="author_link skin-text">' . get_the_author() . '</a></span>'; echo '<span class="port_date skin-text">' . get_the_time('M') . ' ' . get_the_time('j') . ', ' . get_the_time('Y') . '</span> / <span class="port_cats skin-text">' . $pcatso . '</span>'; } } if ($typ == 'blog') { ?> <p> <?php $con = get_the_content(); echo strip_cn($con, $con_lg); ?> </p> <?php } } ?> </div> </div> <?php } else { ?> <?php if ($typ != 'blog') { ?> <div class="<?php echo $fr; ?> <?php echo $roundy; ?> "> <div class="<?php echo $frin; ?> round"> <a href="<?php echo get_permalink(); ?> "><img src="<?php echo bfi_thumb(WP_THEME_URL . '/img/test_bg.jpg', array('width' => 1170, 'height' => 950, 'crop' => true)); ?> " class="<?php echo $roundy; ?> fade fade_ajax" alt="no image" /> </a> <div class="cl"></div> </div> <?php } ?> <?php if ($det == 'yes' || $typ == 'blog') { $pcatso = ''; if ($typ == 'blog') { echo '<div class="recent_inside">'; } else { echo '<div class="portfolio_det">'; } $categoriesy = wp_get_post_categories($post->ID); foreach ($categoriesy as $cate) { $category = get_category($cate); $pcatso .= '<a href="' . get_category_link($category->term_id) . '" class="skin-text" title="' . esc_attr(sprintf(__("View all posts in %s", 'cb-getrends'), $category->name)) . '">' . $category->cat_name . '</a>, '; } $pcatso = substr($pcatso, 0, -2); echo $headi . '<a href="' . get_permalink() . '">' . get_the_title() . '</a>' . $headi_end; if ($typ == 'blog') { echo ' <h3 class="date_title skin-text"><a href="' . get_author_posts_url(get_the_author_meta('ID')) . '" class="author_link">' . get_avatar(get_the_author_meta('ID'), 32) . get_the_author() . '</a> <i class="icon-time"></i> ' . get_the_time('M') . ' ' . get_the_time('j') . ', ' . get_the_time('Y') . ''; echo '</h3>'; } else { echo '<span class="port_author skin-text">by: <a href="' . get_author_posts_url(get_the_author_meta('ID')) . '" class="author_link skin-text">' . get_the_author() . '</a></span>'; echo '<span class="port_date skin-text">' . get_the_time('M') . ' ' . get_the_time('j') . ', ' . get_the_time('Y') . '</span> / <span class="port_cats skin-text">' . $pcatso . '</span>'; } if ($typ == 'blog') { ?> <p> <?php $con = get_the_content(); echo strip_cn($con, $con_lg); ?> </p> <?php } } ?> </div> </div> <?php } ?> <?php if ($typ != 'blog') { ?> <div class="port_item port_<?php echo $post->ID; ?> "> <?php echo '<h1 class="title"><a href="' . get_permalink() . '">' . get_the_title() . '</a></h1>'; ?> <?php echo get_the_content(); ?> <?php $port_url = get_post_meta($post->ID, 'cb4_port_url', 'true'); $port_client = get_post_meta($post->ID, 'cb4_port_client', 'true'); $port_key = get_post_meta($post->ID, 'cb4_port_key', 'true'); echo '<ul>'; if ($port_url != '') { echo '<li><b>' . __('Project URL') . '</b>: <a href="' . $port_url . '" target="_blank">' . $port_url . '</a></li>'; } if ($port_client != '') { echo '<li><b>' . __('Project Client') . '</b>: ' . $port_client . '</li>'; } if ($port_key != '') { echo '<li><b>' . __('Keywords') . '</b>: <i>' . $port_key . '</i></li>'; } echo '</ul>'; echo '<div class="port_arrows"><a class="cb-next-porfolio prev-arrow" data-me-id="' . $post->ID . '" data-action="prev">« ' . __('previous item', 'cb-getrends') . '</a><a class="cb-next-porfolio next-arrow" data-me-id="' . $post->ID . '" data-action="next">' . __('next item', 'cb-getrends') . ' »</a></div>'; ?> </div> <div class="c_item c_item_<?php echo $post->ID; ?> " style="display: none;"> <a href="#" class="prev_item">« <?php _e('prev item', 'cb-getrends'); ?> </a> <a href="#" class="next_item"><?php _e('next item', 'cb-getrends'); ?> »</a> </div> <?php } ?> <div class="cl"></div> <?php if ($typ == 'blog') { ?> </div> <?php } ?> </div> <!--/portfolio post end--> <?php $cc++; } } wp_reset_query(); ?> <div class="cl"></div> </div> <div class="cl"></div> <?php $data = ob_get_contents(); ob_end_clean(); die($data); }
* @hooked woocommerce_template_loop_product_thumbnail - 10 */ do_action('woocommerce_before_shop_loop_item_title'); ?> </div></div> <h3> <?php the_title(); ?> </h3> <div class="product_desc"> <?php echo '<div class="desci">' . strip_cn(get_the_content(), 50) . '</div>'; ?> </div> <?php /** * woocommerce_after_shop_loop_item_title hook * * @hooked woocommerce_template_loop_price - 10 */ do_action('woocommerce_after_shop_loop_item_title'); ?> </a> <div class="cart_container"> <div class="fade_cart"> <?php do_action('woocommerce_after_shop_loop_item'); ?>
echo '</span>'; $categories = get_the_category(); $output = ''; echo '<span class="cats">'; foreach ($categories as $category) { $output .= '<a href="' . get_category_link($category->term_id) . '" title="' . esc_attr(sprintf(__("View all posts in %s", 'cb-getrends'), $category->name)) . '">' . $category->cat_name . '</a>, '; } echo '<i class="icon-folder-open"></i> Posted in: ' . substr(trim($output), 0, -1) . '</span>'; echo '</h3>'; } ?> <p> <?php $con = get_the_content(); echo strip_cn($con, $con_lg); ?> </p> <div class="cat_read_more"> <div class="cb_social"> <a onClick="MyWindow=window.open('http://twitter.com/home?status=Currently Reading <?php the_title(); ?> (<?php the_permalink(); ?> )','MyWindow','width=600,height=400'); return false;" title="Share on Twitter" target="_blank" id="twitter-share"><i