$(this).parent("li").addClass("current");
}
});
+
+ // remove link from posts with less than 16 words
+ for (var i = 0; i < $('div[class*="excerpt"]').length; i++){
+ var words = $(".excerpt" + i).text().split(' ');
+ if(words.length < 16){
+
+ alert($(".excerpt" + i).parent().find("a").attr("href"));
+ $(".excerpt" + i).parent().find("a").replaceWith(function(){
+ return $("<h2 />", {html: $(this).html()});
+ });
+ }
+ }
+
+// alert(words.length);
+// var words = $('div[class*="excerpt"])').text().split(' ');
+// alert(words.length);
/* get number of elements in DOM console.log($("*").length);
var pageBytes = $('html').html().length;
var kbytes = pageBytes / 1024;
$(this).parent("li").addClass("current");
}
});
+
+ // remove link from posts with less than 16 words
+ for (var i = 0; i < $('div[class*="excerpt"]').length; i++){
+ var words = $(".excerpt" + i).text().split(' ');
+ if(words.length < 16){
+
+ alert($(".excerpt" + i).parent().find("a").attr("href"));
+ $(".excerpt" + i).parent().find("a").replaceWith(function(){
+ return $("<h2 />", {html: $(this).html()});
+ });
+ }
+ }
+
+// alert(words.length);
+// var words = $('div[class*="excerpt"])').text().split(' ');
+// alert(words.length);
/* get number of elements in DOM console.log($("*").length);
var pageBytes = $('html').html().length;
var kbytes = pageBytes / 1024;
<div id="home-feed-posts">
<?php
$lastposts = get_posts( $args );
+ $count = 0;
foreach($lastposts as $post) : setup_postdata($post); ?>
<div class="home-feed-post">
<div class="row">
<?php } ?>
<h2 class="title-posts" href="<?php the_permalink(); ?>"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<span class="meta date">Posted on <?php the_time('F jS, Y') ?></span>
- <div><?php echo the_advanced_excerpt('length=225&length_type=characters&no_custom=1&ellipsis=%26hellip;&exclude_tags=a,img,p,strong,h1,h2,h3,hr,div'); ?></div>
+ <div class="excerpt<?php echo $count ?>"><?php echo the_advanced_excerpt('length=225&length_type=characters&no_custom=1&ellipsis=%26hellip;&exclude_tags=a,img,p,strong,h1,h2,h3,hr,div'); ?></div>
</div>
</div>
</div>
<hr>
+ <?php $count++; ?>
<?php endforeach; ?>
</div>
\ No newline at end of file