Plugin Contributor
Savvas
(@savvasha)
Hi there @lentini84 ,
The link to your screenshot is not working for some reason. Can you try a different service like snipboard.io ?
Thanks,
Savvas
Plugin Contributor
Savvas
(@savvasha)
What setting do you have at SportsPress->Settings->Events->Players
? https://snipboard.io/UFLVcI.jpg
Thanks,
Savvas
yes, yes – I set it here to NAME, because I saw that someone asked for something similar and you prompted him this way. But for me, no matter which option I choose – no effect. It keeps sorting by ID, not last nameβ¦
Plugin Contributor
Savvas
(@savvasha)
You are right. Please try to add the following code at your childs theme function.php file:
function wp123_players_selector_args( $args ) {
$args['orderby'] = 'name';
$args['order'] = 'ASC';
return $args;
}
add_filter( 'sportspress_players_selector_args', 'wp123_players_selector_args' );
hmm
i have error “syntax error, unexpected ‘return’ (T_RETURN)”. This applies to: return $args;
Plugin Contributor
Savvas
(@savvasha)
Check that you didnt forget any bracket {
or }
The above code is working just fine in my test environment.
Plugin Contributor
Savvas
(@savvasha)
On line 192 and 193 you are having some “strange” characters [
instead of [
that’s weird, i copied exactly what you sent me. But actually – I fixed it and it works! Thank you very much!
Can I have one more question but related to the table? I mean, is it possible to mark places in each table SEPARATELY in each table? Because at this point I added in the code to highlight places 1-4 in gray. But I would like to add a highlight for each table SEPARATELY! So that in GROUP A it would highlight, for example, places 1-2, and in group B places 1-3. Is it possible?
https://snipboard.io/azqOyQ.jpg
Plugin Contributor
Savvas
(@savvasha)
Please open a new topic for the highlight issue. It will be easier for users with similar questions to seek for support.
I am marking this one as resolved π
Thanks,
Savvas
Savvas,
I’m sorry but I have one more question related to this list of players. Because it actually sorts correctly, but I have a problem with players whose name begins with Ε. This is a letter that occurs only in Polish. What’s strange – in theory it should sort by last name, but in this case the system gives all players whose name starts with Ε at the very end. You can verify it here: https://laczynasdart.pl/zawodnicy-nld/
In Polish, Ε is between L and M.
ok, now i know why. Because it sorts by first name instead of last name. Can this be changed to sort by last name?
Plugin Contributor
Savvas
(@savvasha)
I am afraid that this is not possible. If you check at a Player’s Edit Page you can see that there is only a Name
field. If you select the sortby
name
option then there is no way to differentiate between first-name and last-name/surname.
Instead of writing First-name Last-name
you can write Last-name First-Name
as the name of your player. Then the sorting will be as you want π
Thanks,
Savvas