Player Profile Page
-
I was wanting to combine the profile page I have for my users and the player pages, I’ve tried adding the following to my profile page template, but however $current_teams ends up empty
if ( ! isset( $id ) ) $id = get_the_ID(); $defaults = array('show_nationality_flags' => get_option( 'sportspress_player_show_flags', 'yes' ) == 'yes' ? true : false,); extract( $defaults, EXTR_SKIP ); $player = new SP_Player( $id ); $current_teams = $player->current_teams(); $metrics_before = $player->metrics( true ); $metrics_after = $player->metrics( false ); $html .='<div id="player_team_info" style="overflow:auto;margin-bottom:15px>'; $html .='<label id="current_team">Current Teams</label>'; if ( $current_teams ): $teams = array(); $html .= '<label>WORK PLEASE</label>'; foreach ( $current_teams as $team ): $teams[] = '<a href="' . get_post_permalink( $team ) . '">' . get_the_title( $team ) . '</a>'; $html .= '<a href="' . get_post_permalink( $team ) . '">' . get_the_title( $team ) . '</a>'; endforeach; $label = _n( 'Current Team', 'Current Teams', count( $teams ) ); $data[ $label ] = implode( ', ', $teams ); endif; $html .='</div>';
[Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]
I was wondering if there was an easy way for me to modify the player-details.php to fit my needs, from what I can tell I would be able to add the html I want to the $output variable.
Thanks!
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Player Profile Page’ is closed to new replies.