Types of Custom Fields.
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.









Gnuget (David V) is a Web developer since 2002 working under wordpress the last year.


vt
16 Sep, 2009
There is no usage example for the file upload field. How does one display this field?
Gnuget
18 Sep, 2009
ups, i forget add this type of field…
the File field is almost the same of audio field, i will edit this tutorial for add it.
Thanks for the observation
vt
25 Sep, 2009
0k thanks. Would it also be possible to restrict the file type per field?
Example: I have a file field and I want only .zip files to be allowed for this particular field.
Kulpreet Singh
27 Sep, 2009
Please keep developing Magic Fields! How can I donate to you for your work?
hunk
28 Sep, 2009
hi Kulpreet Singh
we add a button for donation (paypal) if your donation is of another type us you can send an email
Manon
29 Sep, 2009
Your usage is mixed up, checkboxes, lists and dropdowns. It’s not working for me. It’s within the loop in single.php.
I added for my address text field. Not showing up in the post.
I’m using WP 2.8.4
Thanks for any help.
Manon
29 Sep, 2009
Sorry I meant I need to add checkbox list usage to my page template. And it’s not working.
jan
30 Sep, 2009
I’m switching from flutter to magicfields, thanks so much for your improvements! I’m still looking for one feature: how can I change the order of the GROUPS in my new write panel. They are ordered alphabetically and always above the normal fields. I want them in a special order ie. after the none group fields.
hunk
30 Sep, 2009
hi Jan.
at the moment that functionality does not exist but we considered that it is good idea and we will work to implement it
nr
1 Oct, 2009
how do you call all the entries of a field that can be duplicated, and is it possible to call a whole group at once?
hunk
2 Oct, 2009
hi nr
in order to show values of a repeated field you can make something like this http://gist.github.com/199569
I am going to create a function where it returns all the values to you of fields repeated
about the function that returns all the fields of a group,i am working in it, will publish tomorrow it (2-oct-09)
hunk
2 Oct, 2009
ok, the function to obtain the fields of group can find it here http://groups.google.com/group/magic-fields/browse_thread/thread/d30c648b5264d28
Doc4
3 Oct, 2009
I must have slipped a little. I wasn’t aware you had released a version of MagicFields. Congratulations and I look forward to trying it out. You’re already off to a great start with the instructions. Thanks for this.
nr
3 Oct, 2009
great, thanks!
Giraldi Maggio
3 Oct, 2009
Great plugin! Cool! Thanks!
Could you maybe add a ‘Video’ option for the types of field?
Cheers!
Giraldi Maggio
5 Oct, 2009
Or maybe a custom category/tag list?
hunk
5 Oct, 2009
Hi Giraldi
sound good, we will consider it
Thanks
Nathan
6 Oct, 2009
This looks like it is going to be fantastic – exactly what I am after. I’m really pleased that I stumbled across it!
Pete
11 Oct, 2009
Are the uploaded images associated with a post )using this plugin method) attached to that post just like Wp does normally? For example would the [gallery] shortcode work by displaying the images?
hunk
16 Oct, 2009
Hi Pete for show images use get_image(‘name_field’)
Pete
17 Oct, 2009
would the [gallery] short code work?
jan
22 Oct, 2009
Hey guys, I have the same trouble in flutter and magicfields: all breaks in the multinine textfield disappear if I switch between html and visual. with some users they also disappear without switching. any idea? greets!
dobleclic
24 Oct, 2009
Hi,
Great plugin!
I want to add a title for a custom field, and I need to hide this title if the custom file is empty.
How can I do that?
Thanks!
hunk
26 Oct, 2009
hi jan we will review multiline.
hi doblelick. this that you want to do is template? if it is thus, you can use something like
< ?php
if(get('name_field')){
//code
}else{
// more code
}
?>
isni
3 Nov, 2009
hi hunk.. great plugins.. tq for your time..
but i have a problem..
i make an image custom field, but i cant delete it (using delete text under the thumbnail ini editing page). is it a bugs? or only mine? tq for your answer
Gnuget
3 Nov, 2009
Hi isni,
What problem you have when you are deleting the image? when you do click in the image this is not deleted or when you deleted the imagen after to refresh the page the image appear again?
Diaan
25 Nov, 2009
Hi
There is still no guide for how to deal with file uploads, neither does there seem to be a function for getting files.
I have also tried to simply use get(‘field_name’) but that returns nothing.
hunk
25 Nov, 2009
Hi Diaan http://wiki.magicfields.org/doku.php?id=es:type_of_custom_fields#file
terryteo
4 Dec, 2009
first of all, great news that flutter is rising from the ashes. ill be following this development eagerly.
with regards to nr above, returing duplicate groups or duplicate fields has always been flawed in flutter, because when you delete a duplicate then add another duplicate it throws the whole order out.
there is a good fix by thang and nick keenan on this page.
http://groups.google.com/group/flutter-support/browse_thread/thread/904038d01c85ac8c/fa0acab9c99504ae?lnk=gst&q=i%2B%2B#fa0acab9c99504ae
Roy
12 Jan, 2010
How come the anchor buttons don’t work in the multiline editor?
Roy
12 Jan, 2010
Nevermind guys, I messed up.
Keep up the good work!!
Lenner
27 Jan, 2010
Hi Guys, great plug, image upload actually works unlike flutter. Still can’t get api for file upload to work. Hunk’s wiki link says it’s just get(‘pdfupload’) but I get this “http://localhost/www/burnt%20pine%20weddings/wp/wp-content/files_mf/file.pdf”, the actualy path, I need a link to the file.
I also tried get_file(‘pdfupload’) but no luck, can someone please clear this up, as this is vital info. thanks
jason
31 Jan, 2010
Good to see some further development of flutter.
Feature requests:
image associated with checkbox
google maps field
youtube field
xml export or integration with feed wrangler
Jeff Arnold
1 Feb, 2010
Hi,
Sorry if this is a dumb question. I need a list option, either list box, check box, drop down. Its not important. Which only permits 1 selection. Is that possible ?
i.e. if pretend its a list of measurements. if they select gram. Then Kg or litre cannot also be selected.
Many Thanks
Jeff Arnold
1 Feb, 2010
Hi
Again sorry for another dumb question. Is it possible to remove the default Upload / Insert Box Wordpress gives. All of the fields are specified as your fields. I do not want the default. Is this possible.
Many Thanks for any help.
emma
4 Feb, 2010
Hiya
Thanks for this great great plugin! It’s very helpful. I’m wondering though, how do I add an alt tag to my images?
Thanks
tom
5 Feb, 2010
@emma use alt=”
Thanks for this plug-in, just spent all day struggling with flutter then found this!!
Should note on this guide not to copy and paste as get_image(‘field_name’); should be get_image(‘field_name’);
devdarsh
5 Feb, 2010
Currently i am using is amazing plugin. Why draft posts are not showing in manage section of respective custom write panel?
While i do a draft using any write panel, it doesn’t show in respective custom write panel manage tab. I can only see that in default edit posts page.
emma
6 Feb, 2010
Oh, sorry for a silly question, found it at the forum
http://groups.google.com/group/magic-fields/browse_thread/thread/124b248a61591129/5008b1d890144231?lnk=gst&q=alt#5008b1d890144231
Markgt
14 Feb, 2010
Hi there
ive got a question about the Checkbox list – i got it to echo all the options in the page template, but HOW do i echo ONLY the ones that have been ticked??
any help would be appreciated. thanks!
Dan
18 Feb, 2010
Love the plugin so far, great work you guys. I used PODs on a previous site and I like that as well, but I like the simplicity of this plugin. I do have a small question though. Is it possible to create field a that has 2 values or input fields?
For example: Let’s say I want to show a list of Services. For each service there is some text and icon. I am imagining hitting the “duplicate” button in the panel and 2 fields are generated; One for the icon url and the other for the text. Is this possible?
Dan
18 Feb, 2010
Never mind my comment above. Got it figured out, I totally overlooked the “Groups” option, which is very powerful.
Thanks for making this!
KJ
18 Feb, 2010
First off I’d like to say great job at making a better version of flutter, its nice to see the plugin will live one.
One thing that would be nice is to put all the documentation at the top of this page. I had to skim through all the comments to find the function to obtain all the fields (with values) of a group.
Cheers
Gnuget
18 Feb, 2010
Hi,
You are right, we are thinking in give a new skin to the magic fields page… we will take in account your suggestion. for to in the next version of the page all will more easy to access.
Markgt
19 Feb, 2010
Hi Gnuget and Hunk
been looking around and this is still the most versatile custom write panel plugin around – keep up the work!
ONE question: is there any way to either:
1) use the “Related Type” with a list of checkboxes rather – ie list the pages created by another write panel?
2) use the “checkbox list” but instead of inputting the options, rather reference the pages of a particular parent page?
I think this would be a powerful feature – eg you could tick, from a list, all the PRODUCTS that a certain SUPPLIER stocks (where PRODUCT and SUPPLIER are custom write panels.
is there any way to do this / possibility of it being implemented?
thanks for the great plugin!
Dan
20 Feb, 2010
Quick question, is it possible to integrate Pagination with content populated by Magic Fields?
For example; I have a simple “News” area that is setup via Magic Fields and set to Post for Placement. Basically the idea is to have a page that displays 10 “News” Posts and then has pagination to navigate through the posts.
I realize this can be done easily by just making making a “News” category under the WP posts; but I am trying to keep away from doing this as I want the blog section of the site to be controlled by that.
Thanks!
tom
20 Feb, 2010
@dan use a category but exclude it from your blog loop
Dan
21 Feb, 2010
@tom – I’m not sure I am following you a 100%. I tried doing the above (my previous comment) with just the traditional post and assigning it to a category, to which I ran into a bit of a snag. Here’s an idea of what I’ve got.
I have 5 main pages, most have sub pages. One of these main pages is “About” with a sub section of “News” … on this “News” page I’d like to display Posts from a certain category, which I did. But what I don’t like is how when you click on “Continue Reading” to read the full “News” post it uses the “single.php” template.. I could just modify the single.php template to look just like my “News” subpage, but I really don’t want to do that. What I’ve been searching for online is something related to Assigning Posts to Pages. But from what I understand it’s not possible? I found a couple plugins but they didn’t do what I wanted.
I’d really like this to be powered through Magic Fields if its possible. The biggest disconnect I am having is when you are on the “News” page (subpage of About) you see a list of “News” posts and when you click on an individual post you are still in the same template as “News” and the URL would be something like “www.mywebsite.com/about/news/name-of-post”
Sorry for the novel. haha. Any thoughts on how the best approach for this? I push for Magic Fields simply because a full on blog will be added to the site later on and I REALLY want to keep all “blog” related content separate.
Thanks!
tom
21 Feb, 2010
http://www.webdesignerwall.com/tutorials/wordpress-theme-hacks/
look here for ‘Unique Single template’, I’d certainly go this way,unless you had a particular reason for wanting to use a page.
I’d rework the link structure and use a custom category template for your category (eg category-news.php) then set your category structure to something nondescript but relevant, for example on my site I have
http://www.mysite.com/website-design/portfolio/site-i-designed
where /website-design/ is used instead of /category/ (change in permalink settings) /portfolio/ is the category (controlled by magic fields) and /site-i-designed/ is the post using a custom single.php also configured to %%title%% in permalinks. Then for your blog edit index.php to exclude news category and use the default single.php
I’d stop search engines following by category after this but that’s really a matter of the site you have and I’m certainly no SEO expert.
cheers
tom
21 Feb, 2010
should say …category permalink structure to something nondescript……..