Conflict with WP Customer Area plugin
-
Hello, I need a private area in wy website for logged members only, and after searching for plugins I found “Wp Customer area plugin”. It is what I was lookin for but the problem is that apparently there is a js conflict because they use boostrat as framework as well, and their dropdwons menus stop working. So after looking for a solutiion in their forums I found this:
If your dropdown menus are not working, or if you notice something displaying not correctly, (…)This conflict comes from Bootstrap javascript files loaded twice. To fix that conflict, you will need to either disable all Bootstrap JS loaded by your theme, or disable those loaded by WP Customer Area. The best practice for you would be to disable the Bootstrap loaded by your theme when we are displaying a WP Customer Area page. To do that, you need to browse the PHP files from your theme (start by looking into functions.php), and find where Bootstrap JS files are loaded. It should look like this:
wp_enqueue_script(‘bootstrap-scripts’);
Note that the name given to the styles or scripts can depend from your theme or plugin (bootstrap-scripts is just an example slug that your theme could use, you need to find the right one !).Once you have found this, add the following function to the bottom of your functions.php file (preferably inside a child theme):
function fix_cuar_and_theme_bootstrap_conflict(){
if (function_exists(‘cuar_is_customer_area_page’)
&& (cuar_is_customer_area_page(get_queried_object_id())
|| cuar_is_customer_area_private_content(get_the_ID())))
{
wp_dequeue_script(‘bootstrap-scripts’);
}
}
add_action(‘wp_enqueue_scripts’, ‘fix_cuar_and_theme_bootstrap_conflict’, 20);Do not forget to replace the slug bootstrap-scripts by the one you found in your theme or it won’t fix anything.
This is the link: https://wp-customerarea.com/documentation/resolving-bootstrap-conflicts/
Would you please help me finding the piece of code they’re refferring? I can’t find it… Or is there any other solution for my issue?
Thank you in adnvance and my apologies for the long message.
- The topic ‘Conflict with WP Customer Area plugin’ is closed to new replies.