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

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -