function blog_categories($element)
 {
     extract($element['saved'][0]);
     $output = '<div class="span' . $dynamic_size . ' blog_categories">';
     $output .= '<div class="row-fluid"><div class="span12"><div class="header"><h5>' . $dynamic_title . '</h5>';
     $output .= '<ul>';
     $categories = explode(",", $categories);
     if (count($categories) > 0) {
         $i = 0;
         $cl = '';
         foreach ($categories as $cat) {
             $i++;
             if ($i == 1) {
                 $cl = 'active';
             }
             $ca = get_category($cat);
             $output .= '<li class="' . $cl . '"><a href="" data-id="' . $ca->name . '">' . $ca->name . '</a></li>';
             $cl = '';
         }
     }
     $output .= '</ul>';
     $output .= ' </div></div></div>';
     if (!isset($posts_per_page)) {
         $posts_per_page = 9999;
     }
     $query_post = array('posts_per_page' => $posts_per_page, 'post_type' => 'post');
     $output .= '<div class="row-fluid">';
     $output .= '<div class="span12">';
     $loop = new WP_Query($query_post);
     if ($loop->have_posts()) {
         while ($loop->have_posts()) {
             $loop->the_post();
             $post_id = get_the_ID();
             $post_format = get_post_format($post_id);
             if (strlen($post_format) == 0) {
                 $post_format = 'standart';
             }
             if ($post_format == 'standart') {
                 $icon_class = "pencil";
             } elseif ($post_format == 'audio') {
                 $icon_class = "music";
             } elseif ($post_format == 'soundcloud') {
                 $icon_class = "music";
             } elseif ($post_format == 'video') {
                 $icon_class = "play-circle";
             } elseif ($post_format == 'quote') {
                 $icon_class = "quote-left";
             } elseif ($post_format == 'gallery') {
                 $icon_class = "picture";
             }
             $count = 0;
             $comment_entries = get_comments(array('type' => 'comment', 'post_id' => get_the_ID()));
             if (count($comment_entries) > 0) {
                 foreach ($comment_entries as $comment) {
                     if ($comment->comment_approved) {
                         $count++;
                     }
                 }
             }
             $data_cat = '';
             $cat = get_the_category();
             foreach ($cat as $c) {
                 $data_cat .= $c->name . ' ';
             }
             $data_cat = substr($data_cat, 0, -1);
             $output .= '<div class="blog_cat_"  data-cat="' . $data_cat . '">';
             $output .= ' <img src="' . themeple_image_by_id(get_post_thumbnail_id(), 'blog_categories', 'url') . '" alt="">';
             $output .= '<dl class="dl-horizontal blog-article second-style">';
             $output .= '<dt>';
             $output .= '<div class="date"><span class="month">' . get_the_time('d') . ' ' . get_the_time('M') . '</span><span class="year">' . get_the_time('Y') . '</span></div>';
             $output .= '<div class="comments"><i class="icon-comments"></i><span>' . $count . '</span></div>';
             $output .= '</dt>';
             $output .= '<dd>';
             $output .= '<h4><a href="' . get_permalink() . '">' . get_the_title() . '</a></h4>';
             $output .= themeple_content(20);
             $output .= '</dd>';
             $output .= '</dl>';
             $output .= '</div>';
         }
     }
     wp_reset_postdata();
     $output .= '</div>';
     $output .= '</div>';
     $output .= '</div>';
     return $output;
 }
示例#2
0
</a></li> 
                                                </ul>
                                            </div>
                                            <div class="blog-content">        
                                                        <?php 
        if (is_single()) {
            ?>

                                                                    <?php 
            the_content();
            ?>

                                                        <?php 
        } else {
            if ($post_format == 'video' || $post_format == 'audio') {
                echo themeple_content(50);
            } else {
                echo get_the_excerpt();
            }
        }
        ?>
                                            </div>
                                            
                                            <?php 
        if (is_single()) {
            ?>
                                            <?php 
            $item_categories = get_the_category();
            $ctag = '';
            if (is_object($item_categories) || is_array($item_categories)) {
                foreach ($item_categories as $cat) {
                                                        <?php 
        if (is_single()) {
            ?>



                                                                    <?php 
            the_content();
            ?>



                                                        <?php 
        } else {
            if ($post_format == 'video' || $post_format == 'audio') {
                echo themeple_content(30);
            } else {
                echo themeple_text_limit(get_the_excerpt(), 40);
            }
        }
        ?>

                                            </div> 

                                            <a href="<?php 
        echo get_permalink();
        ?>
" class="read_m"><?php 
        _e('Read More', 'themeple');
        ?>
</a>