" <?php 
post_class('entry-box');
?>
>
    <h4 class="entry-title">
        <span class="bold-line"><span></span></span>
        <span class="solid-line"></span>
        <span class="text-title"><?php 
the_title();
?>
</span>
    </h4>
    <!-- entry-title -->

    <?php 
$kopa_audio = kopa_content_get_audio(get_the_content());
if (isset($kopa_audio[0])) {
    $kopa_audio = $kopa_audio[0];
    if (isset($kopa_audio['shortcode'])) {
        ?>
            <div class="entry-thumb">
                <?php 
        echo do_shortcode($kopa_audio['shortcode']);
        ?>
                <!-- video-wrapper -->
            </div>
            <?php 
    } elseif (has_post_thumbnail() && 'show' === kopa_get_option('kopa_theme_options_thumbnail_image')) {
        echo '<div class="entry-thumb">';
        the_post_thumbnail('large');
        echo '</div>';
Example #2
0
function kopa_get_articles($query_args, $stored_month_year)
{
    global $post;
    $posts = kopa_widget_article_build_query($query_args);
    if ($posts->post_count > 0) {
        $previous_date = '';
        $month_year = json_decode(stripslashes($stored_month_year), true);
        $post_id_array = array();
        foreach ($query_args['post__not_in'] as $kopa_post_key => $kopa_post_id) {
            array_push($post_id_array, $kopa_post_id);
        }
        while ($posts->have_posts()) {
            $posts->the_post();
            $post_id = get_the_ID();
            array_push($post_id_array, $post_id);
            $post_url = get_permalink();
            $post_title = get_the_title();
            $current_date = get_the_date('M,Y');
            $_element = array('month' => get_the_date('m'), 'year' => get_the_date('Y'), 'month-year' => get_the_date('M') . '-' . get_the_date('Y'), 'month-text' => get_the_date('F'));
            array_push($month_year, $_element);
            $last_stored_month_year = json_decode(stripslashes($stored_month_year), true);
            $last_array_element = array_pop($last_stored_month_year);
            if ($_element['month-year'] !== $last_array_element['month-year']) {
                if ($current_date != $previous_date) {
                    $previous_date = $current_date;
                    $total_post_no = kopa_total_post_count_by_month(get_the_date('m'), get_the_date('Y'));
                    ?>
                    <div class="time-to-filter clearfix" id="<?php 
                    echo get_the_date('M') . '-' . get_the_date('Y');
                    ?>
">
                        <p class="timeline-filter"><span><?php 
                    echo $current_date;
                    ?>
</span></p>
                        <span class="post-quantity"><?php 
                    echo $total_post_no;
                    if ($total_post_no <= 1) {
                        _e(' Article', kopa_get_domain());
                    } else {
                        _e(' Articles', kopa_get_domain());
                    }
                    ?>
                        </span>
                        <span class="top-ring"></span>
                        <span class="bottom-ring"></span>
                    </div><!--time-to-filter-->
                    <?php 
                }
            }
            switch (get_post_format()) {
                case 'quote':
                    ?>
                    <article class="timeline-item quote-post clearfix">                                                    
                        <div class="timeline-icon">
                            <div><span class="post-type" data-icon="&#xe075;"></span></div>
                            <span class="dotted-horizon"></span>
                            <span class="vertical-line"></span>
                            <span class="circle-outer"></span>
                            <span class="circle-inner"></span>
                        </div>
                        <div class="entry-body clearfix">                                                    
                            <p><?php 
                    the_excerpt();
                    ?>
</p>
                            <center><span class="quote-name"><?php 
                    the_author();
                    ?>
</span></center>
                            <header>
                                <span class="entry-date"><span class="icon-clock-4 entry-icon" aria-hidden="true"></span><span><?php 
                    echo get_the_date();
                    ?>
</span></span></span>
                                <span class="entry-comment"><span class="icon-bubbles-4 entry-icon" aria-hidden="true"></span><?php 
                    comments_popup_link(__('No Comment', kopa_get_domain()), __('1 Comment', kopa_get_domain()), __('% Comments', kopa_get_domain()), '', __('Comments Off', kopa_get_domain()));
                    ?>
</span>
                            </header>
                        </div>
                    </article><!--timeline-item-->
                    <?php 
                    break;
                case 'video':
                    $video = kopa_content_get_video($post->post_content);
                    ?>
                    <article class="timeline-item video-post clearfix">                                                    
                        <div class="timeline-icon">
                            <div><span class="post-type" data-icon="&#xe023;"></span></div>
                            <span class="dotted-horizon"></span>
                            <span class="vertical-line"></span>
                            <span class="circle-outer"></span>
                            <span class="circle-inner"></span>
                        </div>
                        <div class="entry-body clearfix">
                            <div class="kp-thumb hover-effect">
                                <div class="mask">
                                    <a href="<?php 
                    echo $video[0]['url'];
                    ?>
" rel="prettyPhoto" class="link-detail" data-icon="&#xe022;"><span></span></a>
                                </div>
                                <?php 
                    if (has_post_thumbnail()) {
                        the_post_thumbnail('kopa-image-size-1');
                    } else {
                        printf('<img src="%1$s" alt="">', kopa_get_video_thumbnails_url($video[0]['type'], $video[0]['url']));
                    }
                    ?>
                            </div>
                            <header>
                                <h2 class="entry-title"><a href="<?php 
                    echo $post_url;
                    ?>
"><?php 
                    the_title();
                    ?>
</a></h2>
                                <span class="entry-date"><span class="icon-clock-4 entry-icon" aria-hidden="true"></span><span><?php 
                    echo get_the_date();
                    ?>
</span></span>
                                <span class="entry-comment"><span class="icon-bubbles-4 entry-icon" aria-hidden="true"></span><?php 
                    comments_popup_link(__('No Comment', kopa_get_domain()), __('1 Comment', kopa_get_domain()), __('% Comments', kopa_get_domain()), '', __('Comments Off', kopa_get_domain()));
                    ?>
</span>
                            </header>
                            <p><?php 
                    the_excerpt();
                    ?>
</p>
                            <a href="<?php 
                    echo $post_url;
                    ?>
" class="more-link"><?php 
                    _e('Continue Reading &raquo;', kopa_get_domain());
                    ?>
</a>
                        </div>

                    </article><!--timeline-item-->
                    <?php 
                    break;
                case 'gallery':
                    ?>
                    <article class="timeline-item gallery-post clearfix">                                                    
                        <div class="timeline-icon">
                            <div><span class="post-type" data-icon="&#xe01d;"></p></div>
                            <span class="dotted-horizon"></span>
                            <span class="vertical-line"></span>
                            <span class="circle-outer"></span>
                            <span class="circle-inner"></span>
                        </div>
                        <div class="entry-body clearfix"> 
                            <?php 
                    $gallery = kopa_content_get_gallery($post->post_content);
                    if ($gallery) {
                        $shortcode = substr_replace($gallery[0]['shortcode'], ' display_type = 1]', strlen($gallery[0]['shortcode']) - 1, strlen($gallery[0]['shortcode']));
                        echo do_shortcode($shortcode);
                    }
                    ?>
                            <header>
                                <h2 class="entry-title"><a href="<?php 
                    echo $post_url;
                    ?>
"><?php 
                    the_title();
                    ?>
</a></h2>
                                <span class="entry-date"><span class="icon-clock-4 entry-icon" aria-hidden="true"></span><span><?php 
                    echo get_the_date();
                    ?>
</span></span>
                                <span class="entry-comment"><span class="icon-bubbles-4 entry-icon" aria-hidden="true"></span><?php 
                    comments_popup_link(__('No Comment', kopa_get_domain()), __('1 Comment', kopa_get_domain()), __('% Comments', kopa_get_domain()), '', __('Comments Off', kopa_get_domain()));
                    ?>
</span>
                            </header>
                            <span class="load-more-gallery" onclick="more_gallery(jQuery(this));"><span></span></span>
                        </div>                                                    

                    </article><!--timeline-item-->
                    <?php 
                    break;
                case 'audio':
                    ?>
                    <article class="timeline-item audio-post clearfix">                                                    
                        <div class="timeline-icon">
                            <div><span class="post-type" data-icon="&#xe020;"></span></div>
                            <span class="dotted-horizon"></span>
                            <span class="vertical-line"></span>
                            <span class="circle-outer"></span>
                            <span class="circle-inner"></span>
                        </div>
                        <div class="entry-body clearfix">
                            <header>
                                <h2 class="entry-title"><a href="<?php 
                    echo $post_url;
                    ?>
"><?php 
                    the_title();
                    ?>
</a></h2>
                                <span class="entry-date"><span class="icon-clock-4 entry-icon" aria-hidden="true"></span><span><?php 
                    echo get_the_date();
                    ?>
</span></span>
                                <span class="entry-comment"><span class="icon-bubbles-4 entry-icon" aria-hidden="true"></span><?php 
                    comments_popup_link(__('No Comment', kopa_get_domain()), __('1 Comment', kopa_get_domain()), __('% Comments', kopa_get_domain()), '', __('Comments Off', kopa_get_domain()));
                    ?>
</span>
                            </header>
                            <?php 
                    $audio = kopa_content_get_audio($post->post_content);
                    if ($audio) {
                        echo do_shortcode($audio[0]['shortcode']);
                    }
                    ?>
                            <p><?php 
                    the_excerpt();
                    ?>
</p>
                            <a href="<?php 
                    echo $post_url;
                    ?>
" class="more-link"><?php 
                    _e('Continue Reading &raquo;', kopa_get_domain());
                    ?>
</a>
                        </div>

                    </article><!--timeline-item-->
                    <?php 
                    break;
                default:
                    ?>
                    <article class="timeline-item <?php 
                    if (has_post_thumbnail()) {
                        echo ' standard-post ';
                    } else {
                        echo 'link-post';
                    }
                    ?>
 clearfix">
                        <div class="timeline-icon">
                            <div><span class="post-type" data-icon="&#xe034;"></span></div>
                            <span class="dotted-horizon"></span>
                            <span class="vertical-line"></span>
                            <span class="circle-outer"></span>
                            <span class="circle-inner"></span>
                        </div>
                        <div class="entry-body clearfix">
                    <?php 
                    if (has_post_thumbnail()) {
                        ?>
                                <div class="kp-thumb hover-effect">
                                    <div class="mask">
                                        <a class="link-detail" href="<?php 
                        echo $post_url;
                        ?>
" data-icon="&#xe0c2;"></a>
                                    </div>
                                <?php 
                        the_post_thumbnail('kopa-image-size-1');
                        ?>
                                </div>
                    <?php 
                    }
                    ?>
                            <header>
                                <h2 class="entry-title"><a href="<?php 
                    echo $post_url;
                    ?>
"><?php 
                    the_title();
                    ?>
</a></h2>
                                <span class="entry-date"><span class="icon-clock-4 entry-icon" aria-hidden="true"></span><span><?php 
                    echo get_the_date();
                    ?>
</span></span>
                                <span class="entry-comment"><span class="icon-bubbles-4 entry-icon" aria-hidden="true"></span><?php 
                    comments_popup_link(__('No Comment', kopa_get_domain()), __('1 Comment', kopa_get_domain()), __('% Comments', kopa_get_domain()), '', __('Comments Off', kopa_get_domain()));
                    ?>
</span>
                            </header>
                            <p><?php 
                    the_excerpt();
                    ?>
</p>
                            <a href="<?php 
                    echo $post_url;
                    ?>
" class="more-link"><?php 
                    _e('Continue Reading &raquo;', kopa_get_domain());
                    ?>
</a>
                        </div>
                    </article><!--timeline-item-->
                    <?php 
                    break;
            }
            ?>
        <?php 
        }
        ?>
  

        <?php 
        $post_id_string = implode(",", $post_id_array);
        ?>
        <input type="hidden" id="post_id_array" value="<?php 
        echo $post_id_string;
        ?>
">
        <div class="kp-filter clearfix">
            <div onclick="kp_filter_click(jQuery(this))">
                <span>View by:</span><em>All</em>
                <a></a>                                    
                <ul id="ss-links" class="ss-links">
                    <?php 
        $current_month = '';
        $current_year = '';
        foreach ($month_year as $k => $v) {
            if ($v['year'] !== $current_year) {
                $current_year = $v['year'];
                echo '<li class="year"><span>' . $current_year . '</span></li>';
            }
            if ($v['month'] !== $current_month) {
                $current_month = $v['month'];
                echo '<li><a href="#' . $v['month-year'] . '" onclick="kp_filter_li_click(jQuery(this))">' . $v['month-text'] . '</a></li>';
            }
        }
        ?>
                </ul>
                <input type="hidden" id="stored_month_year" value='<?php 
        echo json_encode($month_year);
        ?>
'>
                <input type="hidden" id="no_post_found" value="0">
            </div>
        </div><!--kp-filter-->
        <?php 
    } else {
        ?>
        <input type="hidden" id="no_post_found" value="1">
    <?php 
    }
    wp_reset_postdata();
}