• Resolved tspencer1966

    (@tspencer1966)


    Is there a way to highlight the background of the score of a match based upon the result?

    So for a win the background would be green, a defeat would be red and a draw amber/orange.

    I can’t see a way of doing it in the settings, nor a way to do it with CSS, as there is nothing really to pick out from the source code that means the result is a win, defeat or draw.

    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Savvas

    (@savvasha)

    Hi there @tspencer1966 ,

    You will need some custom code to achieve this. If you use the event-list template you can copy wp-content/plugins/sportspress/templates/event-list.php to wp-content/themes/your-child-theme/sportspress/ folder. Then alter it and using the function sp_get_outcomes() in the events loop you will get an array in format:

    array(
    team_id => outcome_slug,
    team_id => outcome_slug,
    etc..
    )

    You can use this to include a selective class to your event list table so as to color it as you want with some css code.

    Thanks,
    Savvas

    Thread Starter tspencer1966

    (@tspencer1966)

    So, most of that went right over my head.

    I’m a complete PHP novice, so really have no idea how to do this.

    Wondering if anyone has actually done this and has a modified event-list.php file I can drop into my child theme and the CSS code?

    Thread Starter tspencer1966

    (@tspencer1966)

    Nope, can’t get my head around how to do this.

    Any help appreciated.

    Plugin Contributor Savvas

    (@savvasha)

    Hi @tspencer1966 ,

    You can always hire a developer to assist you. Some places you can check are:

    https://jobs.wordpress.net/
    https://www.upwork.com/talent-marketplace/

    Thanks,
    Savvas

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.