From 5e67b6886fb0f84ea33b8ad020a602a36f35f30b Mon Sep 17 00:00:00 2001 From: Vasil Kolev Date: Fri, 10 Oct 2014 17:25:34 +0300 Subject: [PATCH] fix warning, fix news for different languages --- functions.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/functions.php b/functions.php index 2f2d521..ede45ea 100644 --- a/functions.php +++ b/functions.php @@ -34,7 +34,7 @@ function sh_latest_posts($atts){ $result = '

'.$atts['label'].' | '.__('see all', 'initfest').'

'; - $news_args = array( 'category_name' => $cat, 'numberposts' => 3 ); + $news_args = array( 'category_name' => 'news', 'numberposts' => 3, 'lang' => of_get_lang() ); $news = new WP_Query( $news_args ); ob_start(); @@ -157,7 +157,7 @@ function create_sponsors_posttype() { register_post_type( 'sponsors', $args ); } -add_action( 'init', create_sponsors_posttype ); +add_action( 'init', 'create_sponsors_posttype' ); # Create a custom post type for Speakers @@ -200,7 +200,7 @@ function create_speakers_posttype() { register_post_type( 'speakers', $args ); } -add_action( 'init', create_speakers_posttype ); +add_action( 'init', 'create_speakers_posttype' ); # Create a custom post type for Tranportation @@ -219,6 +219,7 @@ function transportation_posttype() { } function openfest_home_page() { + if (empty($wp)) {return true;} ; return !($wp->query_vars['pagename']=='home' || $wp->query_vars['pagename']=='home-2'); }