This topic has 8 replies, 2 voices, and was last updated 6 years, 9 months ago ago by Rose Tyler
Hi, good day.
I’m not sure if this question was already asked but I’m gonna ask anyway.
How can I remove a custom widget area once its created? I can’t seem to find a delete button once the Additional Custom Sidebar is created.
Regards,
Hello,
Please find legenda/framework/js/admin.js file
http://prntscr.com/ieo2e0
and replace with
var delSidebar = '<div class="delete-sidebar">delete</div>';
jQuery('.sidebar-etheme_custom_sidebar').find('.handlediv').before(delSidebar);
jQuery('.delete-sidebar').click(function(){
var confirmIt = confirm('Are you sure?');
if(!confirmIt) return;
var widgetBlock = jQuery(this).closest('.sidebar-etheme_custom_sidebar');
var data = {
'action':'etheme_delete_sidebar',
'etheme_sidebar_name': jQuery(this).parent().find('h2').text()
};
widgetBlock.hide();
jQuery.ajax({
url: ajaxurl,
data: data,
success: function(response){
console.log(response);
widgetBlock.remove();
},
error: function(data) {
alert('Error while deleting sidebar');
widgetBlock.show();
}
});
});
http://prntscr.com/ieo36j
Also, this will be fixed in next theme update.
Regards
Hi thanks for the reply.
I also noticed that the generated ID is the same with the name of the custom widget area. Example I created a custom widget area of “Fußzeile Rechnung” the generated ID will also be id=”Fußzeile Rechnung” which I think is not good, it is suppose to be id=”fusszeile-rechnung”.
See screenshot – https://prnt.sc/ieqscr
Regards,
Hello,
Thanks for the notice.
Please go to legenda/framework/theme-functions.php
find etheme_register_stored_sidebar
function
http://prntscr.com/iez4t5 and replace the id
with 'id' => str_replace( ' ', '-', $name ),
http://prntscr.com/iez57x
Regards
Hi,
The solution that you give, will that be included in the next update?
Regards
Hello,
Yes, we will include this solution also.
Regards
Awesome! Thanks.
Regards
You’re welcome!
Have a nice day.
Regards
Tagged: custom widget area, remove, themes, woocommerce, wordpress
You must be logged in to reply to this topic.Log in/Sign up