• Resolved ferdiax

    (@ferdiax)


    Hello,

    I’m using the Kadence theme and have added the Fibosearch to the main menu, with the option to display only the search icon.
    When i’m logged in it displays correctly, but when logged out it will display with search bar and when the search it will display as icon again untill the next search.

    I’ve deleted all cache (using wp-rocket caching plugin) but does not help.
    All Plugins, Themes and Core are update to last versions.
    Any help would be grateful.

    Thanks

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @ferdiax

    The problem is caused by your cache plugin removing unused CSS, which for some reason also includes FiboSearch CSS.

    To solve the problem add FiboSearch to WP Rocket exceptions. Add the following CSS file to the “CSS safelist” section (see screenshot):

    /wp-content/plugins/ajax-search-for-woocommerce/assets/css/style.min.css


    After that paste the below code to the wp-rocket-exclude-inline-css-rucss.php file. Save and upload. Then go to WP Admin -> Plugins and activate the newly created plugin called WP Rocket | Exclude Inline Styles from Remove Unused CSS.

    Then prevent inline FiboSearch CSS from being removed by Remove Unused CSS. To do that you need to create the folder wp-rocket-exclude-inline-css-rucss file inside wp-content/plugins folder. and inside that folder create the file wp-rocket-exclude-inline-css-rucss.php

    After that paste the below code to the wp-rocket-exclude-inline-css-rucss.php file. Save and upload. Then go to WP Admin -> Plugins and activate the newly created plugin called WP Rocket | Exclude Inline Styles from Remove Unused CSS.

    <?php
    /**
     * Plugin Name: WP Rocket | Exclude Inline Styles from Remove Unused CSS
     * Description: Exclude inline styles from being removed by WP Rocket’s Remove Unused CSS optimizations.
     * Author:      WP Rocket Support Team
     * Author URI:  https://wp-rocket.me/
     * License:     GNU General Public License v2 or later
     * License URI: https://www.gnu.org/licenses/gpl-2.0.html
     *
     * Copyright SAS WP MEDIA 2022
     */
    
    namespace WP_Rocket\Helpers\rucss\rucss_inline_style_exclusions;
    
    // Standard plugin security, keep this line in place.
    defined( 'ABSPATH' ) or die();
    
    /**
     * Exclude inline styles from being removed by WP Rocket’s Remove Unused CSS optimization.
     */
    function inline_exclusions( $inline_exclusions = array() ) {
    
    	/**
    	 * EDIT THIS:
    	 * Edit below line as needed to exclude files.
    	 * To exclude multiple inline css declarations, copy the entire line into a new line for each style declaration you want you exclude.
    	 */
    	$inline_exclusions[] = '.dgwt-wcas';
    	
    	// STOP EDITING
    
    	return $inline_exclusions;
    }
    add_filter( 'rocket_rucss_inline_content_exclusions', __NAMESPACE__ . '\inline_exclusions' );

    After all please test if all works fine.

    Regards,
    Kris

    Thread Starter ferdiax

    (@ferdiax)

    Hi Kris,

    Thanks for your help, it’s working fine now.

    Best regards,

    Ferdiax

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Search not displaying correctly’ is closed to new replies.