Fixed post footers on single and archive templates
authorLaury GvR <laury@gaslightmedia.com>
Wed, 18 Apr 2018 17:05:49 +0000 (13:05 -0400)
committerLaury GvR <laury@gaslightmedia.com>
Wed, 18 Apr 2018 17:05:49 +0000 (13:05 -0400)
These were improperly retrieving the term permalinks by using the
slugs.

archive.php
header.php
single.php
style.css

index 12cd119..9d19fe5 100644 (file)
                         </header>
                         <?php echo the_advanced_excerpt('length=250&length_type=characters&no_custom=1&ellipsis=%26hellip;&exclude_tags=a,img,p,div'); ?>
                         <footer class="entry-meta small-12 medium-6 medium-push-3 center">
-                            <?php $post_categories = wp_get_post_categories( get_the_ID() );
+                            <?php 
+                            $post_categories = wp_get_post_categories( get_the_ID() );
                             $cats = array();
-                            echo 'This entry was posted ';
-                            if (has_category()) {
-                                echo 'in';
+                            if ( has_category ) {
+                                echo 'This entry was posted in';
                                 foreach($post_categories as $c){
                                     $cat = get_category( $c );
-                                    $cats[] = array( 'name' => $cat->name, 'slug' => $cat->slug );
-                                    echo ', <a rel="category" title="View all posts in '. $cat->name . ' " href="'. $cat->slug .'">'. $cat->name .'</a>';
+                                        $cats[] = array( 'name' => $cat->name, 'slug' => $cat->slug );
+                                        if ( $c !== reset( $post_categories ) ) {
+                                            echo ",";
+                                        }
+                                        echo ' <a rel="category" title="View all posts in '. $cat->name . ' " href="'. get_category_link( $cat->term_id ) .'">'. $cat->name .'</a>';
                                 }
                                 echo '.';
                             }
index 5c8f24a..b39734b 100644 (file)
@@ -4,7 +4,7 @@
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
     <title><?php wp_title(); ?></title>
-    <link rel="stylesheet" href="<?php echo get_stylesheet_directory_uri() ; ?>/css/app.css?v=1.2.28">
+    <link rel="stylesheet" href="<?php echo get_stylesheet_directory_uri() ; ?>/css/app.css?v=1.2.29">
     <link rel="shortcut icon" href="<?php echo get_stylesheet_directory_uri() ; ?>/assets/favicon.ico?v=1">
     <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,400italic,700' rel='stylesheet' type='text/css'>
     <?php wp_head(); ?>
index e9670bf..81e4e57 100644 (file)
@@ -40,7 +40,7 @@
                                             foreach($post_categories as $c){
                                                 $cat = get_category( $c );
                                                 $cats[] = array( 'name' => $cat->name, 'slug' => $cat->slug );
-                                                echo '<a rel="category" title="View all posts in '. $cat->name . ' " href="'. $cat->slug .'">'. $cat->name .'</a>, ';
+                                                echo '<a rel="category" title="View all posts in '. $cat->name . ' " href="'. get_category_link( $cat->term_id ) .'">'. $cat->name .'</a>, ';
                                             }
                                         }
                                         $post_tags = wp_get_post_tags( get_the_ID() );
@@ -50,7 +50,7 @@
                                             foreach($post_tags as $t){
                                                 $tag = get_tag( $t );
                                                 $tags[] = array( 'name' => $tag->name, 'slug' => $tag->slug );
-                                                echo '<a rel="category" title="View all posts in '. $tag->name . ' " href="'. $tag->slug .'">'. $tag->name .'</a>, ';
+                                                echo '<a rel="category" title="View all posts in '. $tag->name . ' " href="'. get_tag_link( $tag->term_id ) .'">'. $tag->name .'</a>, ';
                                             }
                                         }
                                         echo ' on ';
index 9f8abbd..a6f3b15 100644 (file)
--- a/style.css
+++ b/style.css
@@ -3,5 +3,5 @@ Theme Name: EmmetCountyGovernment
 Author: Gaslight Media
 Author URI: http://www.gaslightmedia.com
 Description: A theme for EmmetCountyGovernment
-Version: 1.2.28
+Version: 1.2.29
 */