php - What is wrong with this code? -
function themeperauthor_need_switch() { global $post; if ( $get_post_type == 'weblogs' ) { return get_the_author_meta('themeperauthor', $user->id); } return ""; } it doesn't return anything
get_post_type function not variable , $user object should global
function themeperauthor_need_switch() { global $post,$user; if ( get_post_type($post) == 'weblogs' ) { return get_the_author_meta('themeperauthor', $user->id); } return ""; }
Comments
Post a Comment