[Resolved] category css problem

This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

You are not logged in. You can view support threads, but not post.
If you are already logged in, please refresh your browser.

Tagged: 

This topic contains 4 replies, has 2 voices, and was last updated by  Ian Nask 2 months ago. The support staff assigned to this topic is Nigel.

Viewing 5 posts - 1 through 5 (of 5 total)
Author
Posts
#526129

Hi, I had a proble before with categorys style, here is ticket: https://wp-types.com/forums/topic/taxonomies-style/

Now i got more info from my theme support and got to know this form is showing the select fields and the select2 script is added in it, that's why its showing this way (The scripts and styles for select2 is unique and is included in the theme. If any element which uses the select2 this styling will be added in it automatically).

A select2 script is shown this way only and its designed cannot be changed.

I was thinking, is it possible to rename this select field in plugin code somehow or it is defined by html?

#526185

Nigel
Forum moderator

Supporter languages: English (English ) Spanish (Español )

Supporter Timezone: Europe/London (GMT+01:00)

Hi Ian

CRED doesn't add the placeholder attribute to multiple select fields (because the default browser display of such a field doesn't provide for displaying placeholder text).

In your case where you theme is converting the select box to use the select2 library, placeholder text can be added, but as it is your theme initiating the select2 code you don't have an opportunity to add it at the time.

I think your only option in this case it to assign the placeholder attribute yourself using Javascript.

This should work for that particular select dropdown on that page:

( function( $ ) {
	$( window ).load( function(){

		$('.cred-taxonomy-team_department input.select2-search__field').attr({
			'placeholder':'choose something',
			'style':'' 
		});
	});
})( jQuery );

You will need to edit the placeholder text. For some reason there is an inline width style added which prevents the placeholder text being visible which this also removes. And note that I have used the window load event to trigger this code, by when, hopefully, your theme will have replaced the CRED multiselect with the select2 instance.

#526197

Hi,

Thanks for your kind help. I have silly question: Do I need to insert this code in my theme functions.php or somewhere else?

#526202

Nigel
Forum moderator

Supporter languages: English (English ) Spanish (Español )

Supporter Timezone: Europe/London (GMT+01:00)

On your CRED form in the Content Editor there are panels for custom CSS and JS.

You should be able to just copy and paste that code into the custom JS panel.

Let me know how you get on.

#526208

ohh, cool, it's working! Many thanks for your help!

Viewing 5 posts - 1 through 5 (of 5 total)

You are not logged in. You can view support threads, but not post.
If you are already logged in, please refresh your browser.

Known issues and their solutions

We document known issues and their solutions in Toolset erratas. Save time by checking there first and seeing if what you are facing is a known issue. This list is kept short. We do our best to resolve all known issues with every release of Toolset plugins.

Support Policy

Toolset staff will help you use the Toolset plugins correctly, provide any information you need, help troubleshoot problems and advice on best-practices.

Please make sure to issue only one topic per each support ticket.

For more information, read our full Customer Support Policy.

Need custom programming work for your site? Check out our certified partners.