Older PHP version fixes

This commit is contained in:
nikolark committed 2014-09-02 21:39:21 +02:00
1 parent fa28669eb3
commit a6498ff765
2 files changed
+5 -3

No files matched your search

+2 -1
View File
@@ -11,7 +11,8 @@ $posts = new WP_Query( $args );
if( $posts->have_posts() ) : while( $posts->have_posts() ) : $posts->the_post();
$post_category = "";
if( count(get_the_category()) >= 1 ) {
$cat = get_the_category()[0];
$cat = get_the_category();
$cat = $cat[0];
$post_category = '<a href="'. get_category_link($cat->term_id) .'" class="label-category"><span class="dashicons dashicons-tag"></span>'. $cat->name .'</a>';
}
?>
+3 -2
View File
@@ -8,8 +8,9 @@
<?php if( have_posts() ) : while( have_posts() ) : the_post();
$post_category = "";
if( count(get_the_category()) >= 1 ) {
$post_category = get_the_category()[0]->name;
$post_category = "<span class=\"label-category\"><span class=\"dashicons dashicons-tag\"></span>$post_category</span>";
$cat = get_the_category();
$cat = $cat[0];
$post_category = '<a href="'. get_category_link($cat->term_id) .'" class="label-category"><span class="dashicons dashicons-tag"></span>'. $cat->name .'</a>';
} ?>
<article <?php post_class(); ?>>