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.










Any chance of a google map field type?
Okay. Here’s the ultimate-they-gotta-add-this idea. After all, you CAN do the Google map using a textline and some code of your own. But this idea is WAY better.
A Widget Group type. Totally new idea. If you specify a group to be a widget then that widget becomes available for your sidebar use and you can use all the various fields to embed interesting content with the page that will show up With That Page Only in the widget (if you’ve put that widget in a sidebar).
You could use this to do Author sidebar widgets, Table of Contents for the first page, Sidebar google maps that relate to the page content, on and on.
Please do this guys!
Hi,
sorry my ignorance, but what code for radio button?
thanks
Hi francesco check the wiki http://wiki.magicfields.org/doku.php?id=es:type_of_custom_fields#radiobutton_list
is there anyway to echo the value from a listbox option, i don’t want to echo the string, what’s the point of the value anyway? I set the values for each list option as (file name).swf and would like the user to be able to choose one from the list but i don’t want it to say the filename as an option.
Hi Andrew check the wiki http://wiki.magicfields.org/doku.php?id=es:type_of_custom_fields#listbox
[...] y es una de las extensiones más potentes en su clase, con la capacidad de declarar hasta doce tipos distintos de campos personalizados, que incluyen el editor WYSIWYG de WordPress. Aunque ha sido recientemente actualizado y es [...]
[...] plugins om ook op een simpele manier Custom Fields toe te voegen aan je Custom Post Type. Magic Fields (WP.org repository) heeft de meeste Field-types. Denk bijvoorbeeld aan Sliders en Audio. De [...]
Great upgrade (1.4.5), finally we have Media upload, but how can we call it? Is it the same then the other get_image call? or does it have something special?
Is there a way to a) hide the download link on the audio and b) encode the mp3 location, so that people can’t get the mp3 path?
Thanks.
Hi nzahn you can use get_image and gen_image
Hi cournet a)yes, add ?showDownload=false in the funtion get_audio (check this examples http://www.seanhailey.com/mp3/singlemp3player.html) is the same player
I discovered there is a small bug for your magic field, when i activated it, and go to “Media” > “Library”, edit any uploaded image or attachment. The few text fields and labels are disappeared:
——–
Title*
Alternate Text
Caption
——–
Please check
i just notice this solved a problem in 1.4.5:
http://github.com/hunk/Magic-Fields/commit/c4e32dc328b1a40a9f94622dd332da4c82174729#diff-0
I don’t understand how you set the width or height when using the new phpthumb system – I can generate the image with but that gives me the full size image, where do I set the width and height?
http://wiki.magicfields.org/doku.php?id=front-end_functions#gen_image there you can found a few examples about how set the width and height.
I am using magic fields for a custom write panel with an image upload. The image also gets pulled into the side of the site which is on every page of the site, the image shows up on the home page when any other page is selected it disappears – the image is the tshirt on the right.
home: http://bicyclenerd.com/fall
sub-page( no image ): http://www.bicyclenerd.com/fall/archives/4
This is how I call it:
<img src="http://bicyclenerd.com/fall/wp-content/themes/bnfall2/timthumb.php?src=&h=250&w=250&q=50&zc=1);”>
Any help would be great!
Chad, have you fixed it? Im using safari on my iphone and its displaying on both pages.
i use duplicate group, and I have an image in each group. What can i display each photo ?
i used this code :
$team = get_group(‘team’);
foreach($team as $member){
echo $member['namemember'][1];
echo “”;
echo $member['photomember'][1];
echo “”;
}
for the name it’s ok, but the photo is always the same for each member…
could you help me ?
}
Hi sébastien check this http://wiki.magicfields.org/doku.php?id=front-end_functions#get_group
Hunk, i have red this post. I use get_group but what can i display each image ?
i try with this code :
$team = get_group(‘team’);
foreach($team as $member){
echo $member['name'][1];
echo $member['image'][1];
}
one more time it’s ok with the name but it doesn’t work with image. What is the code to display each image in a duplicate group ? please.