• Resolved pressvibes

    (@pressvibes)


    Hello Guys,
    first of all grat plugin, thanks for it!

    I am having issues to customize the Follow part.
    I actually added this code into addtoany.services.php:

    ‘Minds’ => array(
    ‘name’ => ‘Minds’,
    ‘href’ => ‘https://www.minds.com/blahblahmyprofile’,
    ‘icon’ => ‘minds’,
    ‘color’ => ‘FFFFFF’,
    ),

    i added the icon svg format into the folder with icons, and named it “minds”…
    now i can see the social media Minds into the list, i also added the link to my profile… but the icon does not appear.

    what i am doing wrong?

    • This topic was modified 9 months, 1 week ago by pressvibes.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author micropat

    (@micropat)

    I actually added this code into addtoany.services.php

    Your changes to any plugin files will get wiped out after every plugin update, so I recommend following the FAQ on adding a custom follow button.

    Just change https://www.example.com/my-minds-icon.svg and add the following PHP code to a “functionality” plugin such as the Code Snippets plugin:

    function addtoany_add_follow_services( $services ) {
        $services['example_follow_service'] = array(
            'name'        => 'Minds',
            'icon_url'    => 'https://www.example.com/my-minds-icon.svg',
            'icon_width'  => 32,
            'icon_height' => 32,
            'href'        => 'https://www.minds.com/${id}',
        );
        return $services;
    }
    add_filter( 'A2A_FOLLOW_services', 'addtoany_add_follow_services', 10, 1 );
    Thread Starter pressvibes

    (@pressvibes)

    Thank you,
    I am sorry to bother, I am just not that expert with coding!

    so technically i can add whatever, one code for every social media i am going to add, in this way:

    function addtoany_add_follow_services( $services ) {
    $services[‘example_follow_service’] = array(
    ‘name’ => ‘whatever’,
    ‘icon_url’ => ‘https://urltomyicon’,
    ‘icon_width’ => 32,
    ‘icon_height’ => 32,
    ‘href’ => ‘https://www.whatever.blahblah/${id}’,
    );
    return $services;
    }
    add_filter( ‘A2A_FOLLOW_services’, ‘addtoany_add_follow_services’, 10, 1 );


    Or i have to add in ONE snippet more than one?
    like this:



    function addtoany_add_follow_services( $services ) {
    $services[‘example_follow_service’] = array(
    ‘name’ => ‘whatever1’,
    ‘icon_url’ => ‘https://urltomyicon1’,
    ‘icon_width’ => 32,
    ‘icon_height’ => 32,
    ‘href’ => ‘https://www.whatever.blahblah1/${id}’,
    );
    return $services;
    }

    {
    $services[‘example_follow_service’] = array(
    ‘name’ => ‘whatever2’,
    ‘icon_url’ => ‘https://urltomyicon2’,
    ‘icon_width’ => 32,
    ‘icon_height’ => 32,
    ‘href’ => ‘https://www.whatever.blahblah2/${id}’,
    );
    return $services;
    add_filter( ‘A2A_FOLLOW_services’, ‘addtoany_add_follow_services’, 10, 1 );

    • This reply was modified 9 months, 1 week ago by pressvibes.
    • This reply was modified 9 months, 1 week ago by pressvibes.
    • This reply was modified 9 months, 1 week ago by pressvibes.
    Thread Starter pressvibes

    (@pressvibes)

    Hello everyone,
    I did play with code snippet and I found a solution to add as many I want, I paste it here, just in case someone will have the same need, with code snippet this is the code that perfectly works when you want to add more:

    function addtoany_add_follow_services( $services ) {
    $services['example_follow_service_minds'] = array(
    'name' => 'Minds',
    'icon_url' => 'URL.TO.MINDS.ICON',
    'icon_width' => 32,
    'icon_height' => 32,
    'href' => 'https://www.minds.com/${id}',
    );
    $services['example_follow_service_reddit'] = array(
    'name' => 'Reddit',
    'icon_url' => 'URL.TO.REDDIT.ICON',
    'icon_width' => 32,
    'icon_height' => 32,
    'href' => 'https://www.reddit.com/user/${id}',
    );
    $services['example_follow_service_NAMESERVICE'] = array(
    'name' => 'NAMESERVICE',
    'icon_url' => 'URL.TO.THE.ICON',
    'icon_width' => 32,
    'icon_height' => 32,
    'href' => 'URL.TO.SOCIALMEDIA.WITHOUT.YOUR.ID/${id}',
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom Follow’ is closed to new replies.