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.










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!
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?
Never mind my comment above. Got it figured out, I totally overlooked the “Groups” option, which is very powerful.
Thanks for making this!
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
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.
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!
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!
@dan use a category but exclude it from your blog loop
@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!
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
should say …category permalink structure to something nondescript……..
@Dan
the solution to your problem is simple.
http://wordpress.org/extend/plugins/idealien-category-enhancements/
@tom – thanks a bunch. I think that might just be what I am looking for. I will give it a go.
@terry – thanks for the plugin link.
I’d really appreciate it if someone could tell me what code snippet I use to display the contents of a Dropdown List.
In the article one of the sections is ‘Dropdown List’ but the content immediately below it is for ‘Checkbox List’.
How can I use textline to just get an URL? It adds DIV formatting around the returned result.
Kermit Woodall
Managing Editor
GadgetNutz.com
Forget it. Figured out you need to assign it to a variable instead of just echoing it.
Kermit Woodall
Managing Editor
GadgetNutz.com
No wait…that didn’t work…damn.
Kermit Woodall
Managing Editor
GadgetNutz.com
…and the ultimate solution was to turn OFF the Edit in Place options. Just in case anyone wants to know.
[...] Link: Types of Custom Fields. | Magic Fields [...]
[...] Read more here: Types of Custom Fields. | Magic Fields [...]