function widget($args, $instance) { global $theme_option; $title = apply_filters('widget_title', $instance['title']); $category = $instance['category']; $num_fetch = $instance['num_fetch']; // Opening of widget echo $args['before_widget']; // Open of title tag if (!empty($title)) { echo $args['before_title'] . $title . $args['after_title']; } // Widget Content $current_post = array(get_the_ID()); $query_args = array('post_type' => 'post', 'suppress_filters' => false); $query_args['posts_per_page'] = $num_fetch; $query_args['orderby'] = 'post_date'; $query_args['order'] = 'desc'; $query_args['paged'] = 1; $query_args['category_name'] = $category; $query_args['ignore_sticky_posts'] = 1; $query_args['post__not_in'] = array(get_the_ID()); $query = new WP_Query($query_args); if ($query->have_posts()) { echo '<div class="gdlr-recent-post-widget">'; while ($query->have_posts()) { $query->the_post(); echo '<div class="recent-post-widget">'; $thumbnail = gdlr_get_image(get_post_thumbnail_id(), 'thumbnail'); if (!empty($thumbnail)) { echo '<div class="recent-post-widget-thumbnail"><a href="' . get_permalink() . '" >' . $thumbnail . '</a></div>'; } echo '<div class="recent-post-widget-content">'; echo '<div class="recent-post-widget-title"><a href="' . get_permalink() . '" >' . get_the_title() . '</a></div>'; echo '<div class="recent-post-widget-info">' . gdlr_get_blog_info(array('date'), false) . '</div>'; echo '</div>'; echo '<div class="clear"></div>'; echo '</div>'; } echo '<div class="clear"></div>'; echo '</div>'; } wp_reset_postdata(); // Closing of widget echo $args['after_widget']; }
<header class="post-header" > <?php // print blog information if (is_single()) { echo gdlr_get_blog_info(array('author', 'date', 'category', 'comment')); } // blog title $blog_link = empty($post_format_data) ? get_the_title() : $post_format_data; if (is_single()) { echo '<h1 class="gdlr-blog-title"><a href="' . $blog_link . '" >' . get_the_title() . '</a></h1>'; } else { echo '<h3 class="gdlr-blog-title"><a href="' . $blog_link . '" >' . get_the_title() . '</a></h3>'; } // print blog information for widget style if (!is_single() && !empty($gdlr_post_settings['blog-info-widget'])) { echo gdlr_get_blog_info($gdlr_post_settings['blog-info']); } ?> <div class="clear"></div> </header> <?php if (is_single() || $gdlr_post_settings['excerpt'] < 0) { echo '<div class="gdlr-blog-content">'; echo gdlr_content_filter($content, true); wp_link_pages(array('before' => '<div class="page-links"><span class="page-links-title">' . __('Pages:', 'gdlr_translate') . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>')); echo '</div>'; } else { if ($gdlr_post_settings['excerpt'] > 0) { echo '<div class="gdlr-blog-content">' . get_the_excerpt() . '</div>'; } }
<article id="post-<?php the_ID(); ?> " <?php post_class(); ?> > <div class="gdlr-standard-style"> <?php get_template_part('single/thumbnail', get_post_format()); ?> <header class="post-header"> <?php echo gdlr_get_blog_info(array('date', 'comment'), true, '<span class="gdlr-separator">/</span>'); ?> <?php if (is_single()) { ?> <h1 class="gdlr-blog-title"><?php the_title(); ?> </h1> <?php } else { ?> <h3 class="gdlr-blog-title"><a href="<?php echo get_permalink(); ?>
?> > <div class="gdlr-standard-style"> <?php get_template_part('single/thumbnail', get_post_format()); ?> <div class="blog-content-wrapper" > <header class="post-header"> <?php // print blog information if (is_single() && get_post_type() == 'post') { echo gdlr_get_blog_info(array('date', 'author', 'comment', 'category'), true); } else { if (!is_single()) { echo gdlr_get_blog_info(array('date', 'author', 'comment', 'category'), true); } } ?> <div class="clear"></div> </header><!-- entry-header --> <?php if (is_single() || $gdlr_post_settings['excerpt'] < 0) { echo '<div class="gdlr-blog-content">'; echo gdlr_content_filter($gdlr_post_settings['content'], true); wp_link_pages(array('before' => '<div class="page-links"><span class="page-links-title">' . __('Pages:', 'gdlr_translate') . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>')); echo '</div>'; } else { if ($gdlr_post_settings['excerpt'] != 0) { echo '<div class="gdlr-blog-content">' . get_the_excerpt() . '</div>';
get_template_part('single/thumbnail', get_post_format()); ?> <div class="blog-date-wrapper"> <span class="blog-date-day"><?php echo get_the_time('j'); ?> </span> <span class="blog-date-saperator">•</span> <span class="blog-date-month"><?php echo get_the_time('M'); ?> </span> </div> <header class="post-header"> <h3 class="gdlr-blog-title"><a href="<?php echo get_permalink(); ?> "><?php the_title(); ?> </a></h3> <?php echo gdlr_get_blog_info(array('author', 'comment')); ?> <div class="clear"></div> </header><!-- entry-header --> <div class="clear"></div> </div> </article><!-- #post -->
<?php } else { ?> <h3 class="gdlr-blog-title"><a href="<?php echo get_permalink(); ?> "><?php the_title(); ?> </a></h3> <?php } ?> <?php echo gdlr_get_blog_info(array('date', 'author', 'tag'), true); ?> <div class="clear"></div> </header><!-- entry-header --> <?php if ($gdlr_post_settings['excerpt'] < 0) { echo '<div class="gdlr-blog-content">'; echo gdlr_content_filter($gdlr_post_settings['content'], true); wp_link_pages(array('before' => '<div class="page-links"><span class="page-links-title">' . __('Pages:', 'gdlr_translate') . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>')); echo '</div>'; } else { if ($gdlr_post_settings['excerpt'] != 0) { echo '<div class="gdlr-blog-content">'; echo get_the_excerpt();
<?php } else { ?> <h3 class="gdlr-blog-title"><a href="<?php echo get_permalink(); ?> "><?php the_title(); ?> </a></h3> <?php } ?> <?php echo gdlr_get_blog_info(array('date', 'tag', 'author')); ?> <div class="clear"></div> </header><!-- entry-header --> <?php if ($gdlr_post_settings['excerpt'] < 0) { echo '<div class="gdlr-blog-content">'; echo gdlr_content_filter($gdlr_post_settings['content'], true); wp_link_pages(array('before' => '<div class="page-links"><span class="page-links-title">' . __('Pages:', 'gdlr_translate') . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>')); echo '</div>'; } else { if ($gdlr_post_settings['excerpt'] != 0) { echo '<div class="gdlr-blog-content">'; echo get_the_excerpt();
<div class="clear"></div> </header><!-- entry-header --> <?php if (is_single() || $gdlr_post_settings['excerpt'] < 0) { echo '<div class="gdlr-blog-content">'; echo gdlr_content_filter($gdlr_post_settings['content'], true); wp_link_pages(array('before' => '<div class="page-links"><span class="page-links-title">' . __('Pages:', 'gdlr_translate') . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>')); echo '</div>'; } else { if ($gdlr_post_settings['excerpt'] != 0) { echo '<div class="gdlr-blog-content">' . get_the_excerpt() . '</div>'; } } ?> <?php if (is_single()) { ?> <div class="gdlr-single-blog-tag"> <?php echo gdlr_get_blog_info(array('tag'), false); ?> </div> <?php } ?> </div> <!-- blog content wrapper --> </div> </article><!-- #post -->
?> <article id="post-<?php the_ID(); ?> " <?php post_class(); ?> > <div class="gdlr-standard-style"> <?php get_template_part('single/thumbnail', get_post_format()); ?> <header class="post-header"> <h3 class="gdlr-blog-title"><a href="<?php echo get_permalink(); ?> "><?php the_title(); ?> </a></h3> <?php echo gdlr_get_blog_info(array('date')); ?> <div class="clear"></div> </header><!-- entry-header --> <div class="clear"></div> </div> </article><!-- #post -->
<?php } else { ?> <h3 class="gdlr-blog-title"><a href="<?php echo get_permalink(); ?> "><?php the_title(); ?> </a></h3> <?php } ?> <?php echo gdlr_get_blog_info(array('date', 'tag', 'comment')); ?> <div class="clear"></div> </header><!-- entry-header --> <?php if ($gdlr_post_settings['excerpt'] < 0) { echo '<div class="gdlr-blog-content">'; echo gdlr_content_filter($gdlr_post_settings['content'], true); wp_link_pages(array('before' => '<div class="page-links"><span class="page-links-title">' . __('Pages:', 'gdlr_translate') . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>')); echo '</div>'; } else { if ($gdlr_post_settings['excerpt'] != 0) { echo '<div class="gdlr-blog-content">' . get_the_excerpt() . '</div>'; }
?> <div class="gdlr-blog-content-wrapper"> <div class="gdlr-blog-date-wrapper gdlr-info-font"> <div class="gdlr-blog-day"><?php echo get_the_time('j'); ?> </div> <div class="gdlr-blog-month"><?php echo get_the_time('M'); ?> </div> </div> <header class="post-header"> <?php echo gdlr_get_blog_info(array('author', 'comment', 'category'), true, '<span class="gdlr-separator">/</span>'); ?> <?php if (is_single()) { ?> <h1 class="gdlr-blog-title"><?php the_title(); ?> </h1> <?php } else { ?> <h3 class="gdlr-blog-title"><a href="<?php echo get_permalink(); ?> "><?php