Sort icons
-
Hi Geoffrey,
Great plugin, really π
I am looking for a way to classify the icons in alphabetical order.
Any advice to do that, may be a file to edit?… if do so could you please help me to find wich one please?Thanks for your help !
Best regards,
-
Hi π
Try with the added line (the line between the two others) :
// each links (come from options or manual array) sort( $juiz_sps_networks ); foreach($juiz_sps_networks as $k => $v) {
The first line is near the 197th of juiz-social-post-sharer.php file.
If its ok for you I’ll add an action (hook) in there.
Thank you
Thanks for your reply π
I tried with the line.
Links are classified in alaphabetical order, still little issue is only twitter icon appear.
Meaning, i choose to put 6 social links on pages, so links are ok but there is 6 twitter icons that appear as you can see here http://hpics.li/6da4920[url=http://www.hostingpics.net/viewer.php?id=515695beforeafter.jpg][img]http://img11.hostingpics.net/pics/515695beforeafter.jpg[/img][/url]
Thanks for your reply π
I tried with the line.
Links are classified in alaphabetical order, still little issue is only twitter icon appear.
Meaning, i choose to put 6 social links on pages, so links are ok but there is 6 twitter icons that appear as you can see here
http://hpics.li/6da4920Yeah sorry,
The function is not
sort()
butasort()
in that case.
Try withasort( $juiz_sps_networks );
instead of
sort( $juiz_sps_networks );
It works for me.
If it’s ok for you, I will update the plugin.So, use this line of code inside the plugin :
$juiz_sps_networks = apply_filters( 'juiz_sps_networks_array', $juiz_sps_networks );
instead of
asort( $juiz_sps_networks );
That will create a hook you can use from your
functions.php
theme file. Open this file to paste this code at the end:if ( ! function_exists('sort_jsps_networks') ) { add_filter( 'juiz_sps_networks_array', 'sort_jsps_networks' ); function sort_jsps_networks( $networks ) { asort( $networks ); return $networks; } }
Like that, you will keep your customization even if I update the plugin π
Tell me if it’s ok, and please let me a little review, it’s always appreciated π
Good luck!
No problem Geoffrey, thank you !
“asort” works wonderful, icons appear in alphabetical order.
In other hand, when i put the code in function.php i got blank page.
I tried to past it before the end in case of space at the end of the file could create this issue but nothing changed. Anywhere i paste the code i got blank page.
I kept the file this way for the moment since it works but if you have any clue or advice to avoid this i will very happy :))
Many thanks anyway for you reactivity and this great plugin. And, sure, about the review ! πHey,
No problem.
Could you copy/paste the entire code of both files : juiz-social-post-sharer.php and functions.php in a PasteBin ?
I will take a look on it, maybe nothing ^^Thank you,
G.
- The topic ‘Sort icons’ is closed to new replies.