HomePage › Forums › Themes Support › Poco – Fast Food Restaurant WordPress Theme › Login widget problem › Reply To: Login widget problem
December 3, 2020 at 9:41 am
#2122
Hi again,
Ok, I will try to guide for you:
All code, please add into child-theme.
#Step 1: file functions.php
Add code:
global $poco_version;
add_action('wp_enqueue_scripts', function () {
wp_enqueue_script('poco-childtheme', get_stylesheet_directory_uri() . '/custom.js', array(), $poco_version, true);
}, 9999);
#Step 2: create file custom.js and add code:
( function( $ ) {
'use strict';
function account_side() {
var $account_side = $('body .header-group-action .site-header-account a');
var $account_active = $('body .header-group-action .site-header-account .account-dropdown');
$(document).mouseup(function (e) {
if ($account_side.has(e.target).length == 0 && !$account_active.is(e.target) && $account_active.has(e.target).length == 0) {
$account_active.removeClass('active');
}
});
$account_side.on('click', function (e) {
e.preventDefault();
e.stopPropagation();
$account_active.toggleClass('active');
});
}
account_side();
Step 3: add code into file style.css:
header-group-action .site-header-account a .account-content {
display: none; }
.header-group-action .site-header-account .account-dropdown.active {
pointer-events: auto;
opacity: 1 !important;
visibility: visible;
z-index: 999; }
.site-header-account:hover .account-dropdown, .site-header-account:active .account-dropdown {
opacity: 0 !important;
}
.header-group-action .site-header-account:hover .account-dropdown.active, .site-header-account:active .account-dropdown.active{
opacity: 1 !important;
}