Ejemplo n.º 1
0
         <?php 
    }
    ?>
        <?php 
}
?>
        
        <div class="entry">
            <div class="one_half column">
              <?php 
get_template_part('content', 'contactform');
?>
            </div>
            <div class="one_half column last split">
            <?php 
if (get_the_content()) {
    van_content(true, true);
} else {
    echo '<h2>KEEP IN TOUCH WITH US</h2>
                    <p>You can use the following information to contact us if you wanna join us or anything need to communicate.</p>';
    echo van_social();
}
?>
            </div>
        </div>

       </div>
    </section>
</div>
<?php 
get_footer();
 function van_blog($number = 5, $thumbnail = 1, $gridview = 0, $category_slug = '')
 {
     global $post, $more;
     $tmp_post = $post;
     $tmp_more = $more;
     if ($category_slug != '') {
         $category_array = explode(',', $category_slug);
         $args = array('numberposts' => $number, 'orderby' => 'post_date', 'order' => 'DESC', 'tax_query' => array(array('taxonomy' => 'category', 'field' => 'slug', 'terms' => $category_array, 'include_children' => false)));
     } else {
         $args = array('numberposts' => $number, 'orderby' => 'post_date', 'order' => 'DESC');
     }
     $posts = get_posts($args);
     $post_list = '';
     $recent_blog = '';
     foreach ($posts as $post) {
         setup_postdata($post);
         $image_id = get_post_thumbnail_id($post->ID);
         $thumbnail_url = wp_get_attachment_image_src($image_id, 'blog_thumbnail', true);
         $more = 0;
         $url = get_permalink($post->ID);
         $title = $post->post_title;
         if ($thumbnail != 1) {
             $recent_blog .= '<article class="post post-' . $post->ID . '">';
             $excerpt = van_content($echo = false);
             $recent_blog .= '<h2><a href="' . $url . '" title="' . $title . '">' . $title . '</a></h2>';
             $recent_blog .= '<p class="meta">' . __('BY ') . get_the_author() . ' / ' . get_the_category_list(', ') . ' / ' . get_comments_number() . __(' COMMENTS') . '</p>';
             $recent_blog .= '<div class="entry">' . $excerpt . '</div><div class="clearfix"></div>';
             $recent_blog .= '</article>';
         } else {
             //Full Width Layout
             if ($gridview == 1) {
                 $grid = " grid_blog";
             } else {
                 $grid = "";
             }
             $recent_blog .= '<article class="post post-' . $post->ID . '' . $grid . '">';
             if (has_post_thumbnail()) {
                 $recent_blog .= '<div class="thumbnail"><a href="' . $url . '" title="' . $title . '"><img src="' . $thumbnail_url[0] . '" alt="' . $title . '" /></a></div>';
             }
             $recent_blog .= '<h2><a href="' . $url . '" title="' . esc_attr($title) . '" rel="bookmark">' . $title . '</a></h2>';
             $recent_blog .= '<div class="entry">';
             if ($gridview == 1) {
                 if (has_post_thumbnail()) {
                     $recent_blog .= van_truncate(strip_tags(get_the_content()), 120);
                 } else {
                     $recent_blog .= van_truncate(strip_tags(get_the_excerpt()), 300);
                 }
                 $recent_blog .= '<a href="' . get_permalink() . '" class="more-link">' . __('Read More &raquo;', 'SimpleKey') . '</a>';
             } else {
                 if (has_post_thumbnail()) {
                     if ($post->post_excerpt) {
                         $recent_blog .= get_the_excerpt();
                     } else {
                         $recent_blog .= van_truncate(strip_tags(get_the_content()), 250);
                     }
                     $recent_blog .= '<a href="' . get_permalink() . '" class="more-link">' . __('Read More &raquo;', 'SimpleKey') . '</a>';
                 } else {
                     $recent_blog .= van_content(false, false);
                 }
             }
             $recent_blog .= '</div>
            <div class="clearfix"></div>
           </article>';
         }
     }
     $post = $tmp_post;
     $more = $tmp_more;
     return $recent_blog;
 }