Advanced Custom Fields CSS - css

I have a team page built via ACF. I have 5 members and each of them contains a "View Profile" button.
How can I assign a different color code for each of the button using ACF ?
<button style="width:25%; float:right;">View Profile.</button>

The ACF plugin has a color picker field option that you could include in the Team Member field group: https://www.advancedcustomfields.com/resources/color-picker/
So you could, in the template, do something like this:
View Profile
Note that I removed your button wrapper, just for clarity. You probably don't really want to wrap an <a> within a <button>, but I'm guessing you're doing so because of some styling. There's PROBABLY a button class that can be applied to the <a> to give it some nicer styling, depending on what theme you're using.

Related

How can I hide or show some text fields on checkbox click in Woocommerce

I have some text field i.e in custom size(length,with) of product.
I want include a check box , when i click on check box , custom size fields will show/hide on checkbox click.please help me how i can perform this without any code customization.
I had tried some plugins but they add text fields but not show/hide them on checkbox click
First of all you need to add some scripts to make the code work. That is, you need to capture the checkbox click and analysing checked is true or false, you have to write code to show or hide the fields. A simple jQuery function is sufficient.
Or you can use product option plugins to make it work. I don't know which plugin you have used. I have used this one for my client. Try this if you need a plugin.

Add custom button color to Visual Composer button settings

Is there a way to add a custom color/value to the color drop down of the button settings in visual composer? The site I'm developing has lots of colored buttons and rather than overriding one of the existing button classes with css I'd rather add the color(s) to the drop down. Otherwise I have to explain to the client "when you want this color button you have to select x color from the drop down". Which is just confusing.
Thanks!
Check this:
https://kb.wpbakery.com/docs/developers-how-tos/update-single-param-values/
Change all "cta_button" occurrences to "btn". Save the page with the button you want and the color you just created, then use Chrome to inspect the created element. It will come with a class named something like 'vc_btn_color-yourcolor'.
Just style that color on your style.css later.

Adding link with button in drupal

I want to add a button in my drupal website which can redirect me to any specified article/page. Any suggestion will be helpful.
Use the Link module.
It allows you to add a field to your content type that has an href value and a Text value. Then you can change it's display output to output title as link which will output a hyperlink with the text you selected, and once clicked will redirect you to whatever href you set.
If you want to style it to look like a button you can add a CSS class to the Link field you added in your content type under manage fields >> Edit the link field.
I am using Bootstrap subtheme so the button CSS classes are already there for me. i simply add btn btn-default if I want to show a button instead of a hyperlink.
PS: DO NOT CREATE BUTTONS IN A BLOCK. Classes should never go into a block. And if you have clients who are going to use that site, they can mess stuff up pretty fast.
Create Block and put html code for button in block. Enable block on pages where you want.
While putting html code of button into block, please make sure that you have selected "Full Html" filter.

Need to apply a css class to all textfields using Zend Framework

I'm doing some bit of redesigning here for which we hired an outsourced freelance designer. He sent in the designs however he's used css class styles for the textboxes as opposed to my earlier attempts to apply a ganeral style to the inputs tag which had its hiccups.
I've used the Zend View Helpers to create the textboxes however I would like a simpler way to be able to set it up so by default all textfields would have the base css class 'textfield' - is there a way to do so in code without me having to explicitly make the addition in every call made to the view helper?
If you want to apply this style to all textfields on your page you just need a general textfield style and there is no need to even touch your markup.
If you have other textfields as well which you want to style differently, you will have to either extend Zend_Form, Zend_Form_Element or Zend_Form_Element_Text. Probably it would be easiest to extend the former and adding an attribute 'class' with the value 'textfield' to every text element while looping through all form elements.
But again. Why would you need to touch your markup at all, you just need a style for textfields.

How to create custom horizontal radio buttons with CSS?

I want to create radio buttons or other type of controls that will act like this:
[_value1_] [value2] [value3]
Value1 is selected, so it looks like pressed button or selected link (bold, no underline) and other elements are active buttons/links. When user select another value - state is changed. I can handle this event manually, question is - what plugin or existing css/js combination should I use to achieve this?
I am pretty sure that this type of controls have a name, but can't think out what is this. I have tried to search for custom style radio buttons, as functionality is the same, but failed. Also I have tried some other names such as switch buttons, but it's not what I want. It's also very similar to tabs, but tabs usually styled as something that require underline div attached. So I am looking for "radio button meet tabs" css/js solution.
Can you help me to name this control, if you know it's name, or find plugin/existing code that can help me to achieve my goal?
The question is not how to create this type of functionality myself, I can do it, but it's rather strange that there are no existing solutions and I want to help people in same situation, also may be existing solutions design can be better than I can invent myself, because I am not a designer.
Answer
This type of controls can be found as "Simplified CSS Tabs" or "CSS Mini Tabs", but they require some additional code to work as expected.
Also, this type of functionality can be found in Google as jQuery UI radio buttons transformed into a button set and Yahoo UI Button Control: Radio Buttons
http://jqueryui.com/demos/button/#radio
works done for ya bud :)

Resources