Fix the issue with no Advanced Excerpt
authorSteve Sutton <steve@gaslightmedia.com>
Thu, 7 May 2015 21:24:07 +0000 (17:24 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Thu, 7 May 2015 21:24:07 +0000 (17:24 -0400)
If no plugin called Adnvannced Excerpt exists it was giving an error now
it will just use the_excerpt()

root/archive.php
root/home.php
root/search.php

index c32961b..f9490a3 100644 (file)
@@ -2,7 +2,7 @@
 <main class="blog-home">
     <article <?php post_class() ?> id="interior">
         <?php GLM_get_header(); ?>
-    </article> 
+    </article>
     <div class="row">
         <div id="blog-posts-over" class="small-12 medium-9 columns">
             <?php if(have_posts()) : while(have_posts()): the_post();?>
@@ -13,7 +13,7 @@
                             <h1 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title();?></a></h1>
                             <span class="meta date">Posted on <?php the_time('F jS, Y') ?></span>
                         </header>
-                        <?php echo the_advanced_excerpt(); ?>
+                        <?php echo (function_exists('the_advanced_excerpt')) ? the_advanced_excerpt(): the_excerpt(); ?>
                         <footer class="entry-meta small-12 medium-6 medium-push-3 center">
                             <?php $post_categories = wp_get_post_categories( get_the_ID() );
                             $cats = array();
@@ -69,8 +69,8 @@
                     'order' => 'ASC'
                     );
                   $categories = get_categories($args);
-                    foreach($categories as $category) { 
-                      echo '<li><a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '>' . $category->name.'</a> </li> ';  } 
+                    foreach($categories as $category) {
+                      echo '<li><a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '>' . $category->name.'</a> </li> ';  }
                     ?>
                 </ul>
             </div>
index 32ef1d6..cfc46d3 100644 (file)
@@ -13,9 +13,9 @@
                             <h1 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title();?></a></h1>
                             <span class="meta date">Posted on <?php the_time('F jS, Y') ?></span>
                         </header>
-                        <?php echo the_advanced_excerpt(); ?>
+                        <?php echo (function_exists('the_advanced_excerpt')) ? the_advanced_excerpt(): the_excerpt(); ?>
                         <!--the_advanced_excerpt('length=200&length_type=words&no_custom=1&ellipsis=%26hellip;');-->
-                        <!-- This could be wrapped in php tags and be functional, 
+                        <!-- This could be wrapped in php tags and be functional,
                                 but it is easier to change this in admin side-->
                         <footer class="entry-meta small-12 medium-6 medium-push-3 center">
                             <?php $post_categories = wp_get_post_categories( get_the_ID() );
@@ -72,8 +72,8 @@
                     'order' => 'ASC'
                     );
                   $categories = get_categories($args);
-                    foreach($categories as $category) { 
-                      echo '<li><a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '>' . $category->name.'</a> </li> ';  } 
+                    foreach($categories as $category) {
+                      echo '<li><a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '>' . $category->name.'</a> </li> ';  }
                     ?>
                 </ul>
             </div>
@@ -81,5 +81,5 @@
     </div>
     <?php get_footer(); ?>
 
-                        
-                        
+
+
index 42d9347..9a03e76 100644 (file)
@@ -14,7 +14,7 @@
                             <h1 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title();?></a></h1>
                             <span class="meta date">Posted on <?php the_time('F jS, Y') ?></span>
                         </header>
-                        <?php echo the_advanced_excerpt(); ?>
+                        <?php echo (function_exists('the_advanced_excerpt')) ? the_advanced_excerpt(): the_excerpt(); ?>
                         <footer class="entry-meta small-12 medium-6 medium-push-3 center">
                             <?php
                             if (has_category()) {
@@ -71,8 +71,8 @@
                     'order' => 'ASC'
                     );
                   $categories = get_categories($args);
-                    foreach($categories as $category) { 
-                      echo '<li><a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '>' . $category->name.'</a> </li> ';  } 
+                    foreach($categories as $category) {
+                      echo '<li><a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '>' . $category->name.'</a> </li> ';  }
                     ?>
                 </ul>
             </div>