Viewing 8 replies - 1 through 8 (of 8 total)
  • I hope so that profile looks amazing doesn’t it..

    Plugin Author ThemeBoy

    (@themeboy)

    Hi guys,

    The player profile in Football Club uses a very similar system which is built into the theme. Most of that can be achieved by creating your own SportsPress page templates.

    The Premier theme contains custom page templates that use SportsPress data and can also be achieved via adjusting the templates and styling.

    Themeboy is there any info regarding building your own SportsPress page template? sorry if its common knowledge for some people but for me im not quiet sure what that requires sorry
    I want to get a nice looking profile page and get images to work too i cannot for the life in me get them to show even tho feature images works perfectly in other things..any ideas please
    thankyou

    Plugin Author ThemeBoy

    (@themeboy)

    Hi @kev147,

    We’re still working on an integration guide for themes. I’ll try to give you a quick outline here in the meantime. The following is an example of how to create a player profile template.

    1. In your theme’s folder, create a new folder called “sportspress”.

    2. Create a copy of single.php and add it to the sportspress folder. Then, rename that file to single-player.php

    3. Right after the following line (or similar):

    while ( have_posts() ) : the_post();

    add the following line of code:

    $player = new SP_Player( $post );

    4. Now that you have an instance of the SP_Player object, you can use the functions from sportspress/includes/class-sp-player.php, like $player->current_teams(), $player->past_teams(), and $player->metrics().

    5. SP_Player extends the abstract class SP_Custom_Post, so you can also use magic methods to get meta data, like $player->number and $player->nationality.

    6. You can also use standard WP functions like the_title, get_post_meta and get_the_terms.

    7. The rest is the same as creating a standard WP custom page template (see https://codex.www.ads-software.com/Page_Templates).

    You can use this process for creating event, calendar, team, table, list, and staff page templates.

    I hope this helps. We’ll bring out the full integration guide as soon as possible. In the meantime, let me know if you have any questions about any of the steps above. I’d be happy to help you.

    Hi,

    I continue on this thread to ask about some help because, when i create a new player, a post is created with player information instead of a page.

    Does it have a reason to create a post instead of page ?
    Could we change this behavior ? because i don’t want classify players as posts but pages.

    Thanks for your help and congrats for this great plugin !!

    Plugin Author ThemeBoy

    (@themeboy)

    @stgfossoyeurs Glad you’re enjoying the plugin!

    Custom post types are treated by WordPress as posts by default. (see https://codex.www.ads-software.com/Template_Hierarchy#Visual_Overview)

    A workaround, if you want to use a page instead, is to insert shortcodes via the SportsPress icon in the editor, or by copying the shortcodes directly from players.

    Hi and thanks ThemeBoy !

    If i understand correctly, i create my own player page and insert the shortcodes into . But, doint it like this, I expect a problem: I will loose the links from player list to player details because they will point to the player posts instead of player pages.

    Do I have right or do I have missed something ?

    Thanks again for your help ??

    Plugin Author ThemeBoy

    (@themeboy)

    @stgfossoyeurs You’re right. A better (but more advanced) solution is to create your own page template for the player post type. Depending on your theme, this might be as easy as creating a copy of page.php and adding it to your theme folder as sportspress/single-player.php.

    See https://sportspresspro.com/docs/theme-integration-guide/#custom-page-templates

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Question’ is closed to new replies.