is_author() && isset( $wp_query->post ) ) { $GLOBALS['authordata'] = get_userdata( $wp_query->post->post_author ); } } add_action( 'wp', 'atomic_setup_author' ); /* Google fonts URL */ function atomic_google_fonts_url() { // The default Roboto font wp_register_style('atomic-roboto-condensed', '//fonts.googleapis.com/css?family=Roboto+Condensed:400,700', array(), false, 'all'); wp_enqueue_style('atomic-roboto-condensed'); wp_register_style('atomic-lato', '//fonts.googleapis.com/css?family=Lato:400,300,400italic,700,700italic', array(), false, 'all'); wp_enqueue_style('atomic-lato'); $atomic_font_families = array(); // Check if body font is not Lato if ( 'Lato' != get_theme_mod( 'body_font', 'Lato' ) ) { $atomic_font_families[] = get_theme_mod( 'body_font' ) . ':400,300,400italic,700,700italic'; } // Check if heading font is not Roboto and it is different from the body font if ( 'Roboto Condensed' != get_theme_mod( 'headings_font', 'Roboto Condensed' ) && get_theme_mod( 'body_font' ) != get_theme_mod( 'headings_font' ) ) { $atomic_font_families[] = get_theme_mod( 'headings_font' ) . ':700,400,400italic'; } if ( ! empty( $atomic_font_families ) ) { $query_args = array( 'family' => urlencode( implode( '|', $atomic_font_families ) ), 'subset' => urlencode( 'latin,latin-ext' ), ); $fonts_url = add_query_arg( $query_args, "//fonts.googleapis.com/css" ); return $fonts_url; } return false; }