Example #1
0
</a>
				</p>
				<span> | </span>

				<?php 
the_tags("<p class='tags'> <i class='fa fa-tags'> </i>", ', ', "</p> <span> | </span>");
?>

				<p class="category"><i class="fa fa-sitemap"> </i> <?php 
the_category(', ');
?>
</p>
			</div>

			<div class="entry-body"><?php 
echo dttheme_excerpt(50);
?>
</div>

			<a href="<?php 
the_permalink();
?>
" title="<?php 
printf(esc_attr__('%s'), the_title_attribute('echo=0'));
?>
" class="dt-sc-button small"> <?php 
_e('Read More', 'dt_themes');
?>
 </a>
		</div>
	</div>
Example #2
0
								</div>

								<div class="entry-metadata">
									<p class="author <?php echo $hide_author_meta;?>">
										<i class="fa fa-user"> </i>
										<a href="<?php echo get_author_posts_url(get_the_author_meta('ID'));?>" title="<?php _e('View all posts by ', 'dt_themes').get_the_author();?>"><?php echo get_the_author();?></a>
									</p>

									<span class="<?php echo $hide_author_meta;?>"> | </span>

									<?php the_tags("<p class='tags {$hide_tag_meta}'> <i class='fa fa-tags'> </i>",', ',"</p> <span class='{$hide_tag_meta}'> | </span>");?>

									<p class="<?php echo $hide_category_meta;?> category"><i class="fa fa-sitemap"> </i> <?php the_category(', '); ?></p>
								</div><?php
								if( array_key_exists('blog-post-excerpt-length',$tpl_default_settings) ):?>
								<div class="entry-body"><?php echo dttheme_excerpt($tpl_default_settings['blog-post-excerpt-length']);?></div><?php
								endif;?>

								<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__('%s'), the_title_attribute('echo=0'));?>" class="dt-sc-button small"> <?php _e('Read More','dt_themes');?> </a>
							</div>
						</div>
					</article>
				</div><?php 
			endwhile;
		endif;	
		echo '</div>'; #Blog Holder End?>

		<!-- **Pagination** -->
		<div class="pagination blog-pagination">
			<div class="prev-post"><?php previous_posts_link(__('Prev','dt_themes'));?></div>
			<?php echo dttheme_pagination();?>
Example #3
0
	function widget($args, $instance) {
		extract($args);
		global $post;
		$title = empty($instance['title']) ?	'' : strip_tags($instance['title']);
		$_post_count = (int) $instance['_post_count'];
		$_post_categories = "";
		if(!empty($instance['_post_categories']))
			$_post_categories = is_array($instance['_post_categories']) ? implode(",",$instance['_post_categories']) : $instance['_post_categories'];
		$arg = empty($_post_categories) ? "posts_per_page={$_post_count}":"cat={$_post_categories}&posts_per_page={$_post_count}";


		echo $before_widget;
 	    echo $before_title.$title.$after_title;
		echo "<div class='recent-posts-widget'><ul>";		
			 query_posts($arg);
			 if( have_posts()) :
			 while(have_posts()):
			 	the_post();
				$pid = get_the_ID();
				$link = get_permalink();
				$author_id = get_the_author_meta('ID');
				$title = ( strlen(get_the_title()) > 40 ) ? substr(get_the_title(),0,35)."..." :get_the_title();
				echo "<li>";
				echo '	<div class="entry-meta">';
				echo '		<div class="date">';
				echo '			<p class="day">'.get_the_time('d',$pid).'<br>';
				echo '			<span class="month">'.get_the_time('M',$pid).'</span></p>';
				echo '		</div>';
				echo '	</div>';
				echo '	<div class="entry-details">';
				echo '		<div class="entry-title">';
				echo "		<h4><a href='".get_permalink()."'>{$title}</a></h4>";
				echo '		</div>';
				echo '		<div class="entry-metadata">';
				echo "			<p class='author'>".__('by','dt_themes')." <a href='".get_author_posts_url($author_id)."'>".get_the_author_meta('display_name',$author_id)."</a></p><span> | </span>";

							$commtext = "";
							if((wp_count_comments($id)->approved) == 0)	$commtext = '0';
							else $commtext = wp_count_comments($id)->approved;
				echo "		<p class='comments'><a href='{$link}/#respond' class='comments'><span class='fa fa-comments'> </span> {$commtext} </a></p>";

				echo '		</div>';
				echo '	</div>';
				echo '	<div class="entry-body">';
				echo 	dttheme_excerpt(15);
				echo '	</div>';
				echo "</li>";
			 endwhile;
			 else:
			 	echo "<li><h4>".__('No Posts found','dt_themes')."</h4></li>";
			 endif;
			 wp_reset_query();
	 	echo "</ul></div>";			 
		echo $after_widget;
	}
Example #4
0
									<p class="<?php 
        echo $hide_comment_meta;
        ?>
 comments">
										<?php 
        comments_popup_link(__('<span class="fa fa-comments-o"> </span> 0', 'dt_themes'), __('<span class="fa fa-comments-o"> </span> 1', 'dt_themes'), __('<span class="fa fa-comments-o"> </span> %', 'dt_themes'), '', __('<span class="fa fa-comments-o"> </span> 0', 'dt_themes'));
        ?>
									</p>	
								</div><!--  .entry-metadata -->
                                
								 <?php 
        if (array_key_exists('blog-post-excerpt-length', $tpl_default_settings)) {
            ?>
								 	<div class="entry-details-desc"><?php 
            echo dttheme_excerpt($tpl_default_settings['blog-post-excerpt-length']);
            ?>
</div>
								 <?php 
        }
        ?>

							</div>

						</div>
					</article><!-- #post-<?php 
        the_ID();
        ?>
 Ends -->
				</div>
 function widget($args, $instance)
 {
     extract($args);
     global $post;
     $title = empty($instance['title']) ? '' : strip_tags($instance['title']);
     $_post_count = isset($instance['_post_count']) ? (int) $instance['_post_count'] : -1;
     $_post_categories = "";
     if (!empty($instance['_post_categories'])) {
         $_post_categories = is_array($instance['_post_categories']) ? implode(",", $instance['_post_categories']) : $instance['_post_categories'];
     }
     $arg = empty($_post_categories) ? "posts_per_page={$_post_count}" : "cat={$_post_categories}&posts_per_page={$_post_count}";
     echo $before_widget;
     $title = apply_filters('widget_title', $title);
     if (!empty($title)) {
         echo $before_title . $title . $after_title;
     }
     echo "<div class='recent-posts-widget'><ul>";
     query_posts($arg);
     if (have_posts()) {
         while (have_posts()) {
             the_post();
             $link = get_permalink();
             $author_id = get_the_author_meta('ID');
             $title = strlen(get_the_title()) > 40 ? substr(get_the_title(), 0, 35) . "..." : get_the_title();
             echo "<li>";
             echo '	<div class="entry-meta">';
             echo '		<div class="date">';
             echo get_the_date('d M');
             echo '		</div>';
             echo '	</div>';
             echo '	<div class="entry-details">';
             echo '		<div class="entry-title">';
             echo "\t\t<h4><a href='" . get_permalink() . "'>{$title}</a></h4>";
             echo '		</div>';
             echo '		<div class="entry-metadata">';
             echo "\t\t\t<p class='author'>" . __('by', 'dt_themes') . " <a href='" . get_author_posts_url($author_id) . "'>" . get_the_author_meta('display_name', $author_id) . "</a></p><span> | </span>";
             $id = get_the_ID();
             $commtext = "";
             if (wp_count_comments($id)->approved == 0) {
                 $commtext = '0';
             } else {
                 $commtext = wp_count_comments($id)->approved;
             }
             echo "\t\t<p class='comments'><a href='{$link}/#respond' class='comments'><span class='fa fa-comments-o'> </span>{$commtext}</a></p>";
             echo '		</div>';
             echo '	</div>';
             echo '	<div class="entry-body">';
             echo dttheme_excerpt(15);
             echo '	</div>';
             echo "</li>";
         }
     } else {
         echo "<li><h4>" . __('No Posts found', 'dt_themes') . "</h4></li>";
     }
     wp_reset_query();
     echo "</ul></div>";
     echo $after_widget;
 }
 function widget($args, $instance)
 {
     extract($args);
     global $post;
     $title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']);
     $_pages = "";
     if (!empty($instance['_pages']) && is_array($instance['_pages'])) {
         $_pages = array_filter($instance['_pages']);
     } elseif (!empty($instance['_pages'])) {
         $_pages = explode(",", $instance['_pages']);
     }
     $_enabled_image = isset($instance['_enabled_image']) ? $instance['_enabled_image'] : 0;
     $show_title = $instance['_excerpt'] == 'show title only' ? (bool) true : (bool) false;
     $arg = empty($_pages) ? array('post_type' => 'page') : array('post_type' => 'page', 'post__in' => $_pages);
     echo $before_widget;
     echo $before_title . $title . $after_title;
     echo "<div class='recent-pages-widget'><ul>";
     query_posts($arg);
     if (have_posts()) {
         while (have_posts()) {
             the_post();
             $title = strlen(get_the_title()) > 20 ? substr(get_the_title(), 0, 19) . "..." : get_the_title();
             echo "<li>";
             if (1 == $_enabled_image) {
                 $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'my-post-thumb', false);
                 $image = $image != false ? $image[0] : IAMD_BASE_URL . "/images/dummy-images/poster-my-post-thumb.jpg";
                 echo "<a href='" . get_permalink() . "' class='thumb'>";
                 echo "<img src='{$image}' width='71' height='63' alt='{$title}'/>";
                 echo "</a>";
             }
             if ($show_title) {
                 echo "<h6>{$title}</h6>";
             } else {
                 echo "<h6>{$title}</h6>";
                 #echo dttheme_excerpt('dttheme_excerptlength_teaser1', 'dttheme_excerptmore');
                 echo dttheme_excerpt();
             }
             echo "</li>";
         }
     } else {
         echo "<li><h6>" . __('No Pages found', 'dt_themes') . "</h6></li>";
     }
     wp_reset_query();
     echo "</ul></div>";
     echo $after_widget;
 }
Example #7
0
</a>
                </p><span> | </span>

                <?php 
the_tags("<p class='tags'><i class='fa fa-tags'> </i>", ', ', "</p> <span> | </span>");
?>

                <p class="category"><i class="fa fa-sitemap"> </i> <?php 
the_category(', ');
?>
</p><span> | </span>

                <p class="comments">
				<?php 
comments_popup_link(__('<span class="fa fa-comments-o"> </span> 0', 'dt_themes'), __('<span class="fa fa-comments-o"> </span> 1', 'dt_themes'), __('<span class="fa fa-comments-o"> </span> %', 'dt_themes'), '', __('<span class="fa fa-comments-o"> </span> 0', 'dt_themes'));
?>
                </p>
            </div>
            
            <div class="entry-details-desc"><?php 
echo dttheme_excerpt(20);
?>
</div>

        </div>

    </div>
</article><!-- #post-<?php 
the_ID();
?>
 Ends -->
Example #8
0
 function widget($args, $instance)
 {
     extract($args);
     global $post;
     $title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']);
     $_post_count = isset($instance['_post_count']) ? (int) $instance['_post_count'] : -1;
     $_post_categories = "";
     if (!empty($instance['_post_categories']) && is_array($instance['_post_categories'])) {
         $_post_categories = array_filter($instance['_post_categories']);
     } elseif (!empty($instance['_post_categories'])) {
         $_post_categories = explode(",", $instance['_post_categories']);
     }
     $_enabled_image = isset($instance['_enabled_image']) && $instance['_enabled_image'] == 1 ? 1 : 0;
     $show_title = $instance['_excerpt'] == 'show title only' ? (bool) true : (bool) false;
     $arg = array('posts_per_page' => $_post_count, 'post_type' => 'dt_portfolios');
     $arg = empty($_post_categories) ? $arg : array('posts_per_page' => $_post_count, 'tax_query' => array(array('taxonomy' => 'portfolio_entries', 'field' => 'id', 'operator' => 'IN', 'terms' => $_post_categories)));
     echo $before_widget;
     if (!empty($title)) {
         echo $before_title . $title . $after_title;
     }
     echo "<div class='recent-portfolio-widget'><ul>";
     query_posts($arg);
     if (have_posts()) {
         while (have_posts()) {
             the_post();
             $title = strlen(get_the_title()) > 20 ? substr(get_the_title(), 0, 15) . "..." : get_the_title();
             echo "<li>";
             if (1 == $_enabled_image) {
                 $portfolio_settings = get_post_meta($post->ID, '_portfolio_settings', TRUE);
                 $portfolio_settings = is_array($portfolio_settings) ? $portfolio_settings : array();
                 $width = $height = '';
                 if (array_key_exists("items_name", $portfolio_settings)) {
                     $item = $portfolio_settings['items_name'][0];
                     $image;
                     if ("video" === $item) {
                         $image = "http://placehold.it/90&text=Video%20Portfolio";
                     } else {
                         $image = $portfolio_settings['items'][0];
                         $attachment_id = dt_get_attachment_id_from_url($portfolio_settings['items'][0]);
                         $img_attributes = wp_get_attachment_image_src($attachment_id, 'portfolio-widget-thumb');
                         $image = $img_attributes[0];
                         $width = "width='" . $img_attributes[1] . "'";
                         $height = "height='" . $img_attributes[2] . "'";
                     }
                 } else {
                     $image = "http://placehold.it/90&text=Add%20Image%20/%20Video%20%20to%20Portfolio";
                 }
                 echo "<a href='" . get_permalink() . "' class='thumb'>";
                 echo "<img src='{$image}' alt='{$title}' {$width} {$height} />";
                 echo "</a>";
             }
             if ($show_title) {
                 echo "<h6><a href='" . get_permalink() . "'>{$title}</a></h6>";
             } else {
                 echo "<h6><a href='" . get_permalink() . "'>{$title}</a></h6>";
                 echo dttheme_excerpt(5);
             }
             echo "</li>";
         }
     } else {
         echo "<li>" . __('No Portfolio Entries found', 'dt_themes') . "</li>";
     }
     wp_reset_query();
     echo "</ul></div>";
     echo $after_widget;
 }
Example #9
0
	function widget($args, $instance) {
		extract($args);
		global $post;
		$title = empty($instance['title']) ?'' : apply_filters('widget_title', $instance['title']);
		$_post_count = (int) $instance['_post_count'];
		$_post_categories = "";
		if(!empty($instance['_post_categories']) && is_array($instance['_post_categories'])):
			$_post_categories =  array_filter($instance['_post_categories']);
		elseif(!empty($instance['_post_categories'])):
			$_post_categories = explode(",",$instance['_post_categories']);
		endif;
		
		
		$_enabled_image = isset($instance['_enabled_image']) ? $instance['_enabled_image']:0;
		$show_title = ($instance['_excerpt'] == 'show title only') ? (bool) true : (bool) false;

		$arg = array('posts_per_page' => $_post_count ,'post_type' => 'dt_galleries');
		$arg = empty($_post_categories) ? $arg : array(
											'posts_per_page'=> $_post_count,
											'tax_query'		=> array(array( 'taxonomy'=>'dt_gallery_entries', 'field'=>'id', 'operator'=>'IN', 'terms'=>$_post_categories ) ));
		echo $before_widget;
 	    echo $before_title.$title.$after_title;
		echo "<div class='recent-dt-gallery-widget'><ul>";		
			 query_posts($arg);
			 if( have_posts()) :
			 while(have_posts()):
			 	the_post();
				$title = ( strlen(get_the_title()) > 20 ) ? substr(get_the_title(),0,15)."..." :get_the_title();
				echo "<li>";
					if(1 == $_enabled_image):
						 $portfolio_settings = get_post_meta ( $post->ID, '_gallery_settings', TRUE );
                         $portfolio_settings = is_array ( $portfolio_settings ) ? $portfolio_settings : array ();
						 
						 	if( array_key_exists("items_name",$portfolio_settings) ):
								$item =  $portfolio_settings['items_name'][0];
								$image;								
								if( "video" === $item ):
									$image = "http://placehold.it/90&text=Video%20Portfolio";
                                    else:
                                        $image = $portfolio_settings['items'][0];
                                    endif;
                                else:
                                    $image = "http://placehold.it/90&text=Add%20Image%20/%20Video%20%20to%20Portfolio";
                                endif;
								
								echo "<a href='".get_permalink()."' class='thumb'>";
								echo "<img src='$image' alt='{$title}'/>";
								echo "</a>";
					endif;
					
					if($show_title):
						echo "<h6><a href='".get_permalink()."'>{$title}</a></h6>";
					else:
						echo "<h6><a href='".get_permalink()."'>{$title}</a></h6>";
						echo dttheme_excerpt(10);
					endif;
				echo "</li>";
			 endwhile;
			 else:
			 	echo "<li>".__('No Gallery Entries found','dt_themes')."</li>";
			 endif;
			 wp_reset_query();
	 	echo "</ul></div>";			 
		echo $after_widget;
	}