Skip Navigation

[Resolved] I only want to show a drop down with parent categories not with the child

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 3 replies, has 2 voices.

Last updated by Minesh 9 months ago.

Assisted by: Minesh.

Author
Posts
#2625561
Schermopname (137).png

Hi,
on the page hidden link (only if you login you can see the fields). On the left you can add a new category but in the dropdown were you can select your parent categorie it show also the child categories. But I only want to see the parent categories

#2625615

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

I will require admin access details in order to see the problem URL you shared.

*** 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.

#2625789

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please send me FTP access details. I tried to use File Manager plugin to access and modify the theme's functions.php file but its not working.

Please send me FTP access details.

I have set the next reply to private which means only you and I have access to it.

#2627219

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I've added the "Custom CSS and JS" plugin and added the following JS code snippet:
=> hidden link

jQuery(document).ready(function( $ ){
   current_select = jQuery(".page-id-90 .js-wpt-hierarchical-taxonomy-add-new-container:hidden select option").each(function(index,element){
	  
	   if(startsWithSpace(this.text)){
		   $(this).remove();
	   }
   });
	
   
});


function startsWithSpace(str){
  return str.match(new RegExp( /^\s/)) !== null; 
}

AS we want to target to specific page ID. If you add the above code to another site or to another page please replace 90 with your original page/post ID.

Can you please confirm it works as expected:
=> hidden link

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.