In Magic Fields, there are 12 types of “fields”. Below is a detailed explanation of each “field” and how to use them in WordPress.
Please note that the code used to display each “MagicField” must be inside one of the WordPress loops. E.g. In the default theme, “the_content();” is displayed within the “single.php” file – please see the image below:
Textbox.
Usage:
Return: String.
Multiline.
For this field, the same filters used for “the_content();” may be applied using “shortcode“. Please see the images below:
Usage:
Return: String.
Checkbox.
Usage:
if($value){ /*Something*/ }
Return: Bool.
Checkbox List
Usage :
foreach($my_list as $element){
echo $element;
}
Return: Array
DropDown List
Usage:
echo $my_option;
Return: String
ListBox
Usage:
foreach($my_list as $element){
echo $element;
}
Return: Array
Images
Usage:
/**
* With this method is returned the absolute url
* of the image
**/
get_image(‘field_name’);
/**is returned the image tag of html**/
Return: String
Date
Usage:
Return: String. (Return the date in the same format to was selected when was created the custom field, actually exists 8 differents formats of dates)
Audio
Usage:
/**
* With this method return
* the absolute url of the image
**/
echo get_audio(‘field_name’);
/**
*With this method return a flash player
* for the user can ear the song
**/
Color Picker
Usage:
Return : String (hexadecimal number of the Color )
Slider
Usage:
Return: String.










i try this code
$team = get_group(‘equipe’);
foreach($team as $member){
[1]['photo'][1]["o"]; //[indice del grupo][nombre del campo][indice del campo]["o"]
echo $image;
}
it doesn’t work…
i used this code
$team = get_group(‘equipe’);
foreach($team as $member){
[9]['photo'][26]["o"]; //[indice del grupo][nombre del campo][indice del campo]["o"]
echo $image;
}
but i have an error message
i don’t understand what you use [indice del grupo][nombre del campo][indice del campo]["o"] in the function get_group()
could you help me please ?
thanks
dump the array,
$team = get_group(‘equipe’);
pr($team); //see the contain of array
i have do that but i don’t understand. What is the syntax ??
the content of pr($team) is
Array
(
[1] => Array
(
[photo] => Array
(
[1] => Array
(
[o] => http://toto.com/wp-content/files_mf/1285786830Tree.jpg
)
)
[nom] => Array
(
[1] => sergio
)
)
[2] => Array
(
[photo] => Array
(
[1] => Array
(
[o] => http://toto.com/wp-content/files_mf/1285787116TocoToucan.jpg
)
)
[nom] => Array
(
[1] => tobi
)
)
)
i use this code
echo [1]['photo'][1]["o"];
that doesn’t work; what is the line to display images ?
this is not the best place for get support, please open a thread in the google group http://groups.google.com/group/magic-fields
i use this code too :
$team = get_group(‘equipe’);
pr($team); //see the contain of array
$image=[1]['photo'][1]["o"];
echo get($image);
that doesn’t work
yes gnuget, sorry
i have post the question here : http://groups.google.com/group/magic-fields/browse_thread/thread/3b29863639b69352
thanks to help me
ok. if you have the same problem, the response was :
$team = get_group(‘equipe’);
foreach($team as $member){
echo $member['nom'][1];
echo $member['photo'][1]['t'];//thumbnail
echo $member['photo'][1]['o'];//image
}
[...] to set-up, and still very appealing for an inexperienced user. Magic Fields allows you to set up Custom Post Types simply by having you fill out a form with the details. It will automatically add a tab on the [...]
[...] Fields: magicfields.org/types-of-custom-fields/ wiki.magicfields.org/doku.php?id=getting_started [...]
[...] be retrieved with this code:get(‘field_name’);If you need more informations you can see the specific code for each type of field.The CategoriesThere are some core functions to work with the categories.The [...]
We can use shortcode in Multiline field, but shortcode always show in the top of content.
Ex.
The first line. [my_shortcode]. End line
And the result is always [my_shortcode] The first line. End line.
Do you have any idea to fix it?
Hi all ,
this is prabhu
iam not getting choose file for uploading images
can anyone help regarding this issue
Nice documentation! thank you!
Hello !
I want to display date in this format : dd/mm/yyyy (in french dd/mm/aaaa).
Is it possible easily ? How can I do ?
Thank you
[...] But if we are using Magic Fields the custom fields data will be retrieved with this code (more informations here): [...]