Wordpress + Meta box: For each field value - wordpress

I am trying to get value of each clone (adding by +) field value and want to repeat video embed code.
First I am using this wordpress meta box plugin.
http://www.deluxeblogtips.com/2010/04/how-to-create-meta-box-wordpress-post.html
I have a CPT where I want to use one code that will display as per the number of fields. There is a text meta box on CPT where user can add more by clicking on + button means clone. So for each field user will enter different value of image ID. So I want to repeat my code as per the number of field.
So if user adds 3 field it will repeat the code 3 times. which have something this structure.
<div>
<img src="first-field-value" />
</div>
So I want to repeat this structure as per how many field user created and entered the value for that.
I am really sorry if I unable to describe properly. But please let me know if you want to know something more than this.

The Wp Alchemy class at http://farinspace.com/wpalchemy-metabox/ allows for repeating fields.
If you are rolling your own, you need to make sure that the form fields that represent your data entry are named with a trailing '[]', eg; myfieldname[]. This ensures that php treats the values for each cloned item as an array.

Related

Qualtrics and Saving Custom Form Field Responses

I have created a custom form in Qualtrics using the html <form> tag. I have not been able to get any of the text entered into the custom fields to save and display with the other data.
I know it is because I need the correct value for the <form> action attribute. I've searched through the Element Inspector trying to find the .php that is attached to a default text entry field but cannot find one.
Does anyone know how to find out what the .php the rest of the Qualtrics survey is using is or how to go about collecting the entries from a custom text field?
You can't add your own input fields. If you want a text entry field or fields, add a text entry question. If you want to change the look/formatting of the questions use JavaScript or CSS styles to change them.
A second, less desirable option is to use JavaScript event listeners to save your custom fields to embedded data fields when they are updated using setEmbeddedData.

Wordpress Advanced Custom Fields - Limit A User's Choice To One Option

I have a WordPress website and as part of the news items, the editor can add either an:
internal link OR
external link OR
file
Currently I have this set up as a repeater field with maximum rows set to 1.
Is it possible if say one value has been entered, to prevent another of the values from being filled in.
E.g. I add an internal link and then try to add an external link. A message of some sort is then shown to me to say that only one value can be selected at a time.
I know I can add a description to the field with this information but I want to make it idiot proof so that the user can never add more than one value.
Thanks for your time and help in advance.
I can't write this in comments but celeriko right. Install types plugin there is ability of conditional logic. You can very easy implement of from backend.
Types: http://wp-types.com/
Reagrds

Drupal search-api doesn't index custom body field

I've created custom content type, with custom text area field 'field_main_body' (main body field is deleted). The field doesn't show up on search-api index configure page. The search result don't show nodes containing text in this field. I think it's not beeing indexed by search api. I've tried http://ygerasimov.com/add-custom-field-search-api-apachesolr-index sollution, but nothing happened.
Does anyone know how to add this field to search-api index? Or maybe there's another problem here?
Try to re-index until 100% ("admin/config/search/settings" page) or/and run cron. There is no reasons that it is not indexed.

woocommerce: how to add new fields to variations form and show them on frontend

using last versions of wordpress, woocommerce and cheope (theme).
the question: how to
add some extra fields in variations form (text and image field types)
show them on frontend so that their values change accordingly on changing of attributes-select values.
e.g.: the site sells candles and uses variable products, for each kind of candle has several dimensions (with specific different prices), each of which has different duration.
The duration is an important element that I want the user to be informed about.
The same to show the available colors all together.
Unluckily in the standard variation form there is no field where I can insert these or other features.
some help please?
updated 07-August-2013
I succeeded in adding to variations form a new field displayed on back-end, as you can see here, by inserting the code you can find here (please see the comments too) in the function.php file of the theme.
Now, what I’m not able to do is get this field to display with each proper value on front-end (please take a look to the last comment in the above linked page).
Any tip or trick?
thanks
1)Add product attribute and check checkbox Used for variations and Visible on the product page
2)go to variations and add new and fill all fields price and stock must add on them
Your producr display variations and their data

Adding the same existing field twice(more than once) within same content type

I want to reuse the same existing field more than once within the same content type.
Assume that ContentType1 has a field Phone-Number.
Now I want to use the existing field Phone-Number from ContentType1 within ContentType2, but three times. Assume that I want to have contact numbers of three people in the ContentType2. So I want to use the existing field Phone-Number thrice.
It doesn't allow, as once I add the existing field it doesn't appear next time. I tried to export and import. But that didn't work either
A content type can only have a particular field added to it once - this is by design and cannot be changed without some serious hacking of the module. You can change the field's settings to allow for multiple values, I think this is as close as you're going to get though.
Yes you cannot add the same existing field multiple time in same content type. You can Use the every existing field only once in every content type.

Resources