add icon
-
How do I add an icon instead of the back text?
-
Hi @muhammetdkaya,
There is a number of ways to achieve this. Probably one of the simplest – you can set left arrow symbol code, i.e.
←
as “Button label” in our widget’s settings.Please let me know if that’s not good enough, and I’ll come up with other solutions.
I do not use widgets. I am using shortcode in header.
function alg_back_button_shortcode( $atts ) {
$defaults = array(
‘label’ => __( ‘Back’, ‘back-button-widget’ ),
‘class’ => ”,
‘style’ => ”,
‘type’ => ‘input’,
‘js_func’ => ‘back’,
‘hide_on_front_page’ => ‘no’,
‘lang’ => ”,
‘not_lang_text’ => ”,
);Which code should I change for the icon?
can I add font awesome icon ?
also dont work code “[alg_back_button label=”←”]”
- This reply was modified 3 years, 11 months ago by muhammetdkaya.
- This reply was modified 3 years, 11 months ago by muhammetdkaya.
Yes, you can add Font Awesome with e.g.:
[alg_back_button type='simple' label='<i class="fas fa-angle-double-left"></i>']
As for “… also dont work code…” – I’m not sure if I got it correctly, but if you are outputting it with PHP, you can do it with:
$my_fa_icon = '<i class="fas fa-angle-double-left"></i>'; echo do_shortcode( "[alg_back_button type='simple' label='" . $my_fa_icon . "']" );
I’m still not sure if you are adding it via PHP? If not – please try my first example:
[alg_back_button type='simple' label='<i class="fas fa-angle-double-left"></i>']
If that doesn’t help – please update the plugin to the latest v1.2.4 that we’ve just released. There I’ve added special
fa
attribute to the shortcode – now you can use Font Awesome like this:[alg_back_button fa="fas fa-angle-double-left"]
it is work now! thanks!
Happy to hear it’s solved 🙂 Please let me know if you need anything else.
And if you like the plugin, please consider leaving me a rating.
- The topic ‘add icon’ is closed to new replies.