Okay
  Public Ticket #3552278
broken application icons (arrows to go back, forward)
Closed

Comments

  • Martin Mičánek started the conversation

    Hi,

    After updating the calendar from version 3.3.3. on version 5.1.8, all graphic elements stopped working in the plugin (e.g. arrows for going back, going forward), both on the backend and on the frontend. We tried to enter the code in the function.php file according to the instructions, but it generated an error. (see r.png). We use Flatsome as a WP template. When fixing, please remember that the translation of the plugin will still be in progress... so that the error does not happen again. Thank you Micanek

    Attached files:  fe.png
      be1.png
      be2.png
      r.png

  •  877
    Zhivko replied

    Hi,

    It appears the 'font-awesome' hook is already reserved by other plugin using older version of font-awesome.

    I've placed this hook in your child-theme functions.php file:

    /**
     * Makes sure to load Font Awesome 6 only if there are calendar entries
     */
    add_action('admin_enqueue_scripts', 'load_font_awesome_6_style');
    add_action('wp_enqueue_scripts', 'load_font_awesome_6_style');
    add_filter('style_loader_tag', 'font_awesome_6_loader_tag', 10, 4);
    function load_font_awesome_6_style() {
        if (!class_exists('\Stachethemes\Stec\Stachethemes_Event_Calendar')) {
            return;
        }
        $stec        = \Stachethemes\Stec\Stachethemes_Event_Calendar::get_instance();
        $has_entries = $stec->has_calendar_entries();
        $enabled     = \Stachethemes\Stec\Settings::get('misc', 'font_awesome');
        if ($enabled && $has_entries) {
            wp_enqueue_style(
                'font-awesome-6',
                STEC_PLUGIN_URL . 'includes/libs/fontawesome-free-6.4.2-web/css/all.min.css',
                array(),
                STEC_PLUGIN_VERSION
            );
        }
    }
    function font_awesome_6_loader_tag($tag, $handle, $href, $media) {
        if ($handle === 'font-awesome-6') {
            return sprintf('<link rel="preload" href="%s" as="style" onload="this.rel=\'stylesheet\';" media="%s">', $href, $media);
        }
        return $tag;
    }
    

    Stachethemes Developer

  • Martin Mičánek replied

    it seems to work. Thank you very much for your help.