Figure out what is generating the hyphen at the beginning of child category labels
Link to a page where the issue can be seen:
hidden link
I expected to see:
Instead, I got:
This page displays a parametric search of parent categories and child categories. At the front of each child category term is a hyphen or dash. I understand that it is there to show that category is a child of the parent above, but I would like to remove it. Do you have any idea how to do that, or what generates it?
Hello. Thank you for contacting the Toolset support.
To remove those dash (hyphen), we need to add the custom JS code.
If you can share admin access detail - I can add it and share with you.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
To remove the dash, I've added the following JS code to your view's "Search and Pagination" sections JS editor:
jQuery(document).ready(function($){
$("div.radio label:contains('-')").each(function(){
var text = $(this).html();
text = text.replace(" -", "");
$(this).html(text);
});
});
jQuery( document ).on( 'js_event_wpv_parametric_search_form_updated', function( event, data ) {
/**
* data.view_unique_id (string) The View unique ID hash
* data.view_changed_form (object) The jQuery object for the View form after being updated
* data.view_changed_form_additional_forms_only (object) The jQuery object containing additional forms from other instances of the same View inserted using the [wpv-form-view] shortcode
* data.view_changed_form_additional_forms_full (object) The jQuery object containing additional forms from other instances of the same View inserted using the [wpv-view] shortcode
*/
jQuery("div.radio label:contains('-')").each(function(){
var text = jQuery(this).html();
text = text.replace(" -", "");
jQuery(this).html(text);
});
});