Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Mikko Saari

    (@msaari)

    Unfortunately, I only have Divi 4.6.5, so I can’t test the Dynamic CSS feature myself. I’ll have to ask Elegant Themes if they could give me the latest version so I could test this myself.

    What exactly breaks in the CSS? What is different between the pages? I’m not sure how Relevanssi could affect this in the first place, as Relevanssi shouldn’t be interested in the CSS of the search results pages at all. But I don’t know at all what Dynamic CSS does exactly, so I’m just guessing here.

    Plugin Author Mikko Saari

    (@msaari)

    Now that I tried Dynamic CSS, I see no difference in the search results templates on my test site. It’s something that’s specific to your theme, then. What element it is exactly that breaks?

    Thread Starter onico0

    (@onico0)

    Hi Mikko

    sorry

    it seems my previous answer was reject by WP.org moderation for un unknown reason?

    Copy :
    _

    For now, it seems that

    add_filter( 'et_use_dynamic_css', function() 
        { 
            if(is_search()) 
            { 
                return false; 
            }
        } );

    is doing the trick to disable Dynamic CSS Performance for specific Search Pages.
    When?Dynamic CSS?(Divi > Performance) is enable with?Relevanssi Excerpt?(a must), it’s like Divi do no load the Custom CSS needed for almost everything in Divi Theme and Divi Builder.
    See attachment in the first post for a preview.

    Update :

    Also, Divi > “style-static.min.css” was embedded in some search results pages, but not all. So strange.

    Here my second workaround :

    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles', 11);
    
    function theme_enqueue_styles() {
        if(is_search()) 
        { 
                    
            if ( !wp_style_is( 'divi-style-parent', 'enqueued' ) ) { 
                wp_enqueue_style( 'divi-style-parent', get_template_directory_uri() . '/style.css', array(), $theme_version );
            }
            if ( !wp_style_is( 'divi-style', 'enqueued' ) ) { 
                wp_enqueue_style( 'divi-style', get_template_directory_uri() . '/style.css', array(), $theme_version );
            }
        }
    }

    Hope that help.

    • This reply was modified 2 years, 8 months ago by onico0. Reason: tiny correction
    • This reply was modified 2 years, 8 months ago by onico0. Reason: small code improvement
    Plugin Author Mikko Saari

    (@msaari)

    I think a good place to go debugging this is the Divi functions.php and the function et_divi_print_stylesheet(). This function seems to be responsible for printing out the embedded stylesheets when Dynamic CSS is enabled.

    Another place to check is the function et_use_dynamic_css() in /includes/builder/feature/dynamic-assets/dynamic-assets.php, perhaps this is returning false instead of true for some reason.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Relevanssi broke the Divi Search Results Pg when Dynamic CSS perfs is activated’ is closed to new replies.