Fixed Blog footer links to Uncategorized
authorLaury GvR <laury@gaslightmedia.com>
Wed, 18 Apr 2018 17:12:21 +0000 (13:12 -0400)
committerLaury GvR <laury@gaslightmedia.com>
Wed, 18 Apr 2018 17:12:21 +0000 (13:12 -0400)
Links to Uncategorized would break because of improper retrieval
of the category's slug. This has been fixed. So too has the awkward
comma in "This has been posted in, Uncategorized."

Fix applied to archive.php, single.php and home.php

archive.php
home.php
single.php

index fe9e13d..863c3a0 100644 (file)
@@ -52,7 +52,7 @@
 
                                         $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() );
@@ -62,7 +62,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_category_link( $tag->term_id ) .'">'. $tag->name .'</a>, ';
                                     }
                                 }
                                 
index c3e4f88..aeb807b 100644 (file)
--- a/home.php
+++ b/home.php
@@ -51,7 +51,7 @@
 
                                         $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() );
@@ -61,7 +61,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>, ';
                                     }
                                 }
                                 
index 6ced5a4..32b39fa 100644 (file)
@@ -49,7 +49,7 @@
 
                                         $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() );
@@ -59,7 +59,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>, ';
                                     }
                                 }