</div> <div class="cb-meta"> <h2 class="h4"><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <?php echo cb_byline(); ?> <div class="cb-excerpt"><?php echo cb_clean_excerpt(150, false); ?> </div> </div> </article> <?php if ($i % 2 != 0) { echo '</div>'; } $i++; } if ($cb_closer == true) { echo '</div>';
?> </div> <div class="cb-meta"> <h2><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <?php echo cb_byline(); ?> <div class="cb-excerpt"><?php echo cb_clean_excerpt(120); ?> </div> </div> </article> <?php $cb_count++; } echo '</div>'; } wp_reset_postdata();
<div class="cb-meta clearfix"> <h2 class="cb-post-title"><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <?php cb_byline($cb_post_id); ?> <div class="cb-excerpt"><?php echo cb_clean_excerpt(160); ?> </div> <?php cb_post_meta($cb_post_id); ?> </div> </article> <?php } $cb_count++; }
<div class="cb-meta clearfix"> <h2 class="cb-post-title"><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <?php cb_byline($cb_post_id); ?> <div class="cb-excerpt"><?php echo cb_clean_excerpt(140); ?> </div> <?php cb_post_meta($cb_post_id); ?> </div> </article> <?php $cb_count++; $i++; } echo '</div>';
function my_posts_screen_content() { get_template_part('directory-to-content-file'); $theuser = bp_displayed_user_id(); $paged = get_query_var('paged') ? get_query_var('paged') : 1; query_posts(array('posts_per_page' => 5, 'author' => $theuser, 'cb_offset_loop' => $cb_offset_loop, 'paged' => $paged)); if (have_posts()) { while (have_posts()) { the_post(); ?> <article id="post-<?php the_ID(); ?> " class="cb-blog-style-a clearfix<?php if (is_sticky()) { echo ' sticky'; } if ($cb_category_color_style != NULL) { echo ' ' . $cb_category_color_style; } ?> " role="article"> <div class="cb-mask" style="background-color:<?php echo $cb_category_color; ?> ;"> <?php cb_thumbnail('300', '200'); echo cb_review_ext_box($cb_post_id, $cb_category_color); echo $cb_post_format_icon; ?> </div> <div class="cb-meta"> <h2 class="h4"><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <?php echo cb_byline(); ?> <div class="cb-excerpt"><?php echo cb_clean_excerpt(210, false); ?> </div> </div> </article> <?php } wp_reset_query(); // resets main query } else { ?> <h1>Sorry...</h1> <p><?php _e('You have not posted any article.'); ?> </p> <h4> <a style="color: grey" href="<?php echo home_url(); ?> //add-new/"><?php esc_html_e("Add an article now", 'cubell'); ?> </a></h4> <?php } }
function widget($args, $instance) { $cache = wp_cache_get('widget_recent_posts', '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); $title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Posts', 'cubell') : $instance['title'], $instance, $this->id_base); $category = apply_filters('widget_category', empty($instance['category']) ? '' : $instance['category'], $instance, $this->id_base); $type = apply_filters('widget_type', empty($instance['type']) ? 'cb-small' : $instance['type'], $instance, $this->id_base); if (empty($instance['number']) || !($number = absint($instance['number']))) { $number = 5; } if ($category != 'cb-all') { $cb_cat_qry = $category; } else { $cb_cat_qry = NULL; } $r = new WP_Query(apply_filters('widget_posts_args', array('posts_per_page' => $number, 'no_found_rows' => true, 'category_name' => $cb_cat_qry, 'post_status' => 'publish', 'ignore_sticky_posts' => true))); if ($r->have_posts()) { echo $before_widget; if ($title) { echo $before_title . $title . $after_title; } ?> <ul class="cb-light <?php echo $type; ?> "> <?php while ($r->have_posts()) { $r->the_post(); global $post; $cb_custom_fields = get_post_custom(); $cb_global_color = ot_get_option('cb_base_color', '#eb9812'); $cb_meta_onoff = ot_get_option('cb_meta_onoff', 'on'); $cb_review_checkbox = get_post_meta(get_the_id(), "cb_review_checkbox"); if ($type == 'cb-small') { $width = '80'; $height = '60'; $cb_small_box = true; $cb_class = NULL; } if ($type == 'cb-big') { $width = '360'; $height = '240'; $cb_small_box = false; $cb_class = ' class="h2"'; } $cb_all_categories = get_the_category(); $cb_current_cat_id = $cb_all_categories[0]->term_id; $cb_category_color = get_tax_meta($cb_current_cat_id, 'cb_color_field_id'); if ($cb_category_color == "#" || $cb_category_color == NULL) { $cb_parent_cat_id = $cb_all_categories[0]->parent; if ($cb_parent_cat_id != '0') { $cb_category_color = get_tax_meta($cb_parent_cat_id, 'cb_color_field_id'); } if ($cb_category_color == "#" || $cb_category_color == NULL) { $cb_category_color = $cb_global_color; } } $cb_post_id = $post->ID; $cb_post_format_icon = cb_post_format_check($cb_post_id); ?> <li class="cb-article clearfix"> <div class="cb-mask" style="background-color:<?php echo $cb_category_color; ?> ;"> <?php cb_thumbnail($width, $height); echo cb_review_ext_box($cb_post_id, $cb_category_color, $cb_small_box); echo $cb_post_format_icon; ?> </div> <div class="cb-meta"> <h4<?php echo $cb_class; ?> ><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h4> <?php echo cb_byline(false, $cb_post_id, true); ?> <?php if ($type == 'cb-big') { echo '<div class="cb-excerpt">' . cb_clean_excerpt(120) . '</div>'; } ?> </div> </li> <?php } ?> </ul> <?php echo $after_widget; ?> <?php // 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_recent_posts', $cache, 'widget'); }
echo $cb_post_format_icon; ?> </div> <div class="cb-meta"> <h2 class="h4"><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <?php echo cb_byline(); ?> <div class="cb-excerpt"><?php echo cb_clean_excerpt(210, false); ?> </div> </div> </article> <?php } cb_page_navi(); } wp_reset_postdata();
function cb_get_post_meta_wrap($cb_post_id = NULL, $cb_like_count = 'on', $cb_link_overlay = 'on', $cb_excerpt = NULL) { $cb_output = '<div class="cb-meta-data">'; $cb_output .= '<h2 class="cb-post-title"><a href="' . esc_url(get_the_permalink()) . '">' . get_the_title() . '</a></h2>'; if ($cb_like_count == 'on') { $cb_output .= '<a href="' . esc_url(get_the_permalink()) . '">' . cb_get_like_count($cb_post_id) . '</a>'; } $cb_output .= '</div>'; if ($cb_link_overlay == 'on') { $cb_output .= '<a href="' . esc_url(get_the_permalink()) . '" class="cb-link-overlay"></a>'; } if ($cb_excerpt != NULL) { $cb_output .= cb_clean_excerpt(); } return $cb_output; }
<?php cb_byline($cb_post_id); ?> <?php if (ot_get_option('cb_bs_d_length', 'cb-bs-d-excerpt') != 'cb-bs-d-excerpt') { ?> <div class="cb-excerpt"><?php the_content(); ?> </div> <?php } else { ?> <div class="cb-excerpt"><?php echo cb_clean_excerpt(250); ?> </div> <?php } ?> <?php cb_post_meta($cb_post_id); ?> </div> </article> <?php
<div class="cb-meta"> <h2 class="cb-post-title"><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <?php cb_byline($cb_post_id); ?> <div class="cb-excerpt"><?php echo cb_clean_excerpt(300); ?> </div> <?php cb_post_meta($cb_post_id); ?> </div> </article> <?php $cb_count++; } echo '</div>';