Older PHP version fixes
This commit is contained in:
1 parent
fa28669eb3
commit
a6498ff765
2 files changed
+5
-3
No files matched your search
@@ -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>';
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -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(); ?>>
|
||||
|
||||
Reference in new issue
Block a user