Divi solution wppp_divi_override breaks Theme Customizer
-
Some people use the ‘wppp_divi_override’ function to override the theme options of Divi since that fights with the dropdown menu of however many products per page you want.
However, we noticed that the custom code can cause another set of issues – the inability of using the Divi Theme Customizer. The code I’m referring to what was posted in a support thread before:
https://www.ads-software.com/support/topic/conflict-with-divi-theme-5/Since the thread is closed I cannot add our (more appropriate) solution to the original thread which is why I made this one.
So in case you had the same issue, here is the code that uses a ‘if(function_exists … )’ code rather than just running all the time:
/* * Override theme posts per page. */ add_action( 'pre_get_posts', 'wppp_divi_override', 9 ); function wppp_divi_override() { if( function_exists('woocommerce_products_will_display')) : remove_action( 'pre_get_posts', 'et_custom_posts_per_page', 10 ); endif; }
Hope it helps someone out there!
- The topic ‘Divi solution wppp_divi_override breaks Theme Customizer’ is closed to new replies.