Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author ThemeBoy

    (@themeboy)

    Hi Pedro,

    Good point! I’ll add a filter that you can use to change the order of the descriptions in custom posts.

    Currently, all descriptions are outputted after the templates. I’ll let you know what the hook is called when I release the next update.

    Thread Starter sopedro

    (@sopedro)

    Thank you Themeboy.

    Plugin Author ThemeBoy

    (@themeboy)

    Hi Pedro,

    I’ve added the filter “sportspress_{$post_type}_content_priority” to all custom post types. It defaults to 10, and the possible positions are:

    sportspress_before_single_{$post_type} – 5
    sportspress_single_{$post_type}_content – 10
    sportspress_after_single_{$post_type} – 15

    The content will be inserted after the action. For example, changing the player content priority to 5 by using this filter will insert the content between sportspress_before_single_player and sportspress_single_player_content:

    add_filter( 'sportspress_player_content_priority', 'my_player_content_priority' );
    function my_player_content_priority() {
    return 5;
    }

    The hook is available in version 1.1.4

    https://wordpress.org/plugins/sportspress/changelog/

    Thread Starter sopedro

    (@sopedro)

    Hi Themeboy,

    I came back to this point again.
    I tried this hook but it inserts the description before all the template and what i want to do is place de description between player details(photo, team, etc…) and the player statistics.

    Is this possible?

    Regards,

    Pedro

    Plugin Author ThemeBoy

    (@themeboy)

    Hi Pedro,

    The player profile content is added either before or after the post content, so you’ll need to create a custom template to do this.

    First, unhook all of the player content actions by adding these 3 lines to your theme’s functions.php:

    remove_action( 'sportspress_single_player_content', 'sportspress_output_player_details', 10 );
    remove_action( 'sportspress_single_player_content', 'sportspress_output_player_statistics', 20 );
    remove_action( 'sportspress_single_player_content', 'sportspress_output_br_tag', 100 );

    Then, following this theme integration guide, create a file in your theme’s folder under sportspress/single-player.php:

    https://sportspresspro.com/docs/theme-integration-guide/

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Hooks Order’ is closed to new replies.