Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Geoffrey

    (@creativejuiz)

    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

    Thread Starter AValden

    (@avalden)

    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]

    Thread Starter AValden

    (@avalden)

    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

    Plugin Author Geoffrey

    (@creativejuiz)

    Yeah sorry,

    The function is not sort() but asort() in that case.
    Try with

    asort( $juiz_sps_networks );

    instead of

    sort( $juiz_sps_networks );

    Plugin Author Geoffrey

    (@creativejuiz)

    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!

    Thread Starter AValden

    (@avalden)

    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 ! πŸ™‚

    Plugin Author Geoffrey

    (@creativejuiz)

    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.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Sort icons’ is closed to new replies.