From a6498ff76544cad2ac45f6c61ab0f1e24974e0cd Mon Sep 17 00:00:00 2001 From: Nikolai R Kristiansen Date: Tue, 2 Sep 2014 21:39:21 +0200 Subject: [PATCH] Older PHP version fixes --- wp-content/themes/aktiv2014/activities.php | 3 ++- wp-content/themes/aktiv2014/index.php | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/wp-content/themes/aktiv2014/activities.php b/wp-content/themes/aktiv2014/activities.php index 77ec64f..036fc68 100644 --- a/wp-content/themes/aktiv2014/activities.php +++ b/wp-content/themes/aktiv2014/activities.php @@ -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 = ''. $cat->name .''; } ?> diff --git a/wp-content/themes/aktiv2014/index.php b/wp-content/themes/aktiv2014/index.php index 1fc1c85..9360887 100644 --- a/wp-content/themes/aktiv2014/index.php +++ b/wp-content/themes/aktiv2014/index.php @@ -8,8 +8,9 @@ = 1 ) { - $post_category = get_the_category()[0]->name; - $post_category = "$post_category"; + $cat = get_the_category(); + $cat = $cat[0]; + $post_category = ''. $cat->name .''; } ?>
>