• Resolved saokimthanglong

    (@saokimthanglong)


    How to change icon for button?
    I want to change the Home button icon to show the Back icon.
    Please support. Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Danish Ali Malik

    (@danish-ali)

    Hi @saokimthanglong,

    Hope you are doing good today ??

    I added the related icons only into each section of the icons. But you can add any custom icon by using the filter. Just put the following snippet into your active theme functions.php file custom icon would show into Home icons list.

    /*
     * Adding custom Icon into the list
     */	
    function fl_home_icons_cb($icons){
    
    	/*
    	 * Adding arrow-left icon to the list from fontawesome.
    	 * Choose any icon from fontawesome list. Here you can find all icons->https://fontawesome.com/v4.7.0/icons/
    	 * Use only name of the icon like "fa fa-arrow-left" would be only "arrow-left"
    	 */		
    	 $icons[] = 'arrow-left';
    
    	 /*
    	 * Returning back the icons list.
    	 */	
    	 return $icons;
    }
    /*
     * Filter to add custom icon into home icons list.
     */	
    add_filter('fl_home_icons', 'fl_home_icons_cb');

    Select that icon from floating links settings page->Design->Change Icons and Home Icon section.

    Following are other filters to add any custom icon into any section.

    • fl_left_icons
    • fl_right_icons
    • fl_random_icons
    • fl_up_icons
    • fl_down_icons
    • fl_copy_url_icons
    • fl_slimer_close_icon
    • fl_slimer_open_icon

    Thanks for using the plugin

    Thanks for posting this workaround. It works for me. However…

    Is there a way to not use the fontawesome list? I just want it to say “Next” and “Prev” and “Home”

    Is that possible?

    Plugin Author Danish Ali Malik

    (@danish-ali)

    Hi @genscripter,

    Hope you are doing good today ??

    Right now there is not an option available to filter out the floating links bar but I will definitely add into a future release.

    [ Signature deleted ]

    Thanks for the quick info.

    If I may be so bold to add to this thread (maybe for the benefit of future users of the Floating Links utility, which I love), if users add more assignments to the $icons[] array, they can get more than one additional icon in their list. See below:

    function fl_random_icons_cb($icons){
    	 $icons[] = 'bullseye';
    	 $icons[] = 'globe';
    	 $icons[] = 'map';
    	 return $icons;
    }
    add_filter('fl_random_icons', 'fl_random_icons_cb');
    Plugin Author Danish Ali Malik

    (@danish-ali)

    Hi @genscripter,

    Hope you are doing good today ??

    I have added filters in the plugin to change the content and HTML on runtime. You can find all the filters in floating-links/filters.txt file with an example.

    [ Signature deleted ]

    • This reply was modified 5 years, 5 months ago by Jan Dembowski.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Change icon for button’ is closed to new replies.