reducing the blog body excerpt characters and placing the title below the image
authorAnthony Talarico <talarico@gaslightmedia.com>
Thu, 4 Aug 2016 17:28:24 +0000 (13:28 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Thu, 4 Aug 2016 17:28:24 +0000 (13:28 -0400)
views/frontPage.php

index ede9c2a..5d5f5dd 100644 (file)
@@ -1,23 +1,24 @@
 <?php
         
 echo '<div class="hubspot-container">'
-        . '<div class="hubspot-title">'
-            . '<a href="' .$url .'">'
-                . '<h1>' . $title. '</h1>'
-            . '</a>'
-        . '</div>'
+       
         . '<a class="image-link" href="' .$url .'">'
             . '<div class="hubspot-featured-image" style="margin: 0 auto;width: 200px; height: 200px;background: url('. $image_url . ') no-repeat center    center;">'
             . '</div>'
         . '</a>'
-        . '<div class="hubspot-blog">' . $content . '</div>'
+         . '<div class="hubspot-title">'
+            . '<a href="' .$url .'">'
+                . '<h1>' . $title. '</h1>'
+            . '</a>'
+        . '</div>'
+        . '<div class="hubspot-blog-content">'. $content . '</div>'
         . '<a href="' .$url .'"> Read More </a>'
   . '</div>';
         ?>
 
 <script type="text/javascript">
     
-     var blog = jQuery('.hubspot-blog');
+     var blog = jQuery('.hubspot-blog-content');
      var image_link = jQuery(".image-link");
      var image = jQuery(".hubspot-featured-image");
      var blog_characters = blog.text().length;
@@ -26,8 +27,8 @@ echo '<div class="hubspot-container">'
      image_link.css("display", "block").css("width", "200px");
      blog.find('img').remove();
 
-     if(blog_characters > 600){
-         blog.text(blog.text().substring(0,600) + '...');
+     if(blog_characters > 550){
+         blog.text(blog.text().substring(0,550) + '...');
      }
 
 </script>
\ No newline at end of file