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

3 Answers
3

You are using get_post_type as variable instead of a function try:

function themeperauthor_need_switch() {
    global $post;
  if ( get_post_type($post) == 'weblogs' )  {
    return get_the_author_meta('themeperauthor', $user->ID);
  }
  return "";
}

Leave a Comment