Getting Started

This tutorial will be explain the basic use of Magic Fields, how create write panels, how create custom fields and how print in the template.

Installing Magic Fields.

Magic Fields is installed as any wordpress plugin, you just need download from his download page, put the folder in:

wp-content/plugins

And in the admin area in the plugins section do click in the “activate” link and its all.

When you active the plugin the first thing to Magic Field ask is for create two folders, this folders are:

/wp-content/files-mf /

and

/wp-content/plugins/Magic-Fields/thirdparty/phpthumb/cache

Is enough to you create these folders and give them enough permissions for be writable by Magic Fields

Now we are on road for start to use Magic Fields!

Basic Usage

The best way to understand how Magic Fields Works is with a example, in this example i want create a portfolio of my work. So, the first thing to do is a create a category called “portfolio” and after that create our write panel and assigned the category “portfolio”

Add a new write panel

Add a new write panel

Write Panels ‹ magic_fields — WordPress

In the write panel page exists many options, this options will be explained more a detail in the future for now i just leave the options by default.

Write Panels ‹ magic_fields — WordPress-1

After to create the write panel I’m going to add custom fields for this write panel, for now I will create just one custom field for add the services to I gave to the client.

create_field

Write Panels ‹ magic_fields — WordPress-2

In this page I can choice what type of custom field I want in this case I want a textbox field, and I give the name of “services” and the Label of Services.

I don’t want to this field be required and I don’t want to this field can be duplicated. (the duplicate featured will be explain in detail in the next’s posts)

And it’s all now we can enter to the portfolio panel and now we can start to create content.

Add New Post ‹ magic_fields — WordPress-1

We can view our post created with our write panel in the “Manage” option.

Edit Posts ‹ magic_fields — WordPress

Displaying our information in the template.

Well now we need display the information to be added in our template, for that Magic Fields give us a little api for this. Lets go.

In our single.php file we can add this:

echo get('services');

And it’s all.

Now if we visit the post we will see the information to we put in the services field.

Client name « magic_fields

Exists many more things to we can do with Magic Fields, in the next’s posts I will talk about the differents types of fields.

UPDATE: For more information about Magic fields visit the wiki

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • BarraPunto
  • LinkedIn
  • Meneame
  • Reddit
  • Slashdot
  • Tumblr

105 Responses to “Getting Started”

  1. hunk says:

    Hi kineta, to remove the div is necessary to disable EIP (settings-> Magic fields) or using the get and set the EIP parameter to false

    http://wiki.magicfields.org/doku.php?id=front-end_functions#get

  2. hunk says:

    Hi Kineta,

    One more question. I’m not able to get the assigned categories to work. It defaults to uncategorized. Not a big deal, but it would be nice to get it to work.

    which browser?

  3. kineta says:

    The assigned category isn’t working for me in either Chrome and IE 8.

    Thanks for your help. This really is a very useful and well made plugin.

  4. kineta says:

    Oh, ps – re the category problem. I’m using WordPress Beta 3.0 – perhaps that’s the problem?

  5. [...] de publicación especializada sobre WordPress. Los interesados harán bien en estudiar el manual de uso básico, el manual sobre tipos de campos personalizados y, sobre todo, la completísima documentación del [...]

  6. Courtney says:

    Hi — I also am looking for the same thing as Mike H: a way to have the additional multi-line fields use TinyMCE Advanced. I don’t like the default one and would like the editors to be consistent.

    Love the plugin, though! Thanks.

  7. daddydesign says:

    Kineta, did you ever find the solution for the default category issue? we are having the same problem..

  8. David says:

    Hi, Thanks for the plug-in, I am however having some issues lol.
    I am new to wordpress and want to add multiple fields to a page which can be updated ongoing. I believe I have done it right but its not working so I guess I did something wrong.
    Where in the single.php file do I place the [echo get('services');] code?
    Is it just in this one php file that I put the code?
    and finally, it the single.php file in the theme directory of the main WordPress directory?

    Thank you again!
    D

  9. hunk says:

    hi David
    1.- yes
    2.- no, in all files you want to show the field
    3.- no, the main is index.php

  10. kineta says:

    To daddydesign – no unfortunately, I’m still having the problem that my category settings are being ignored or overridden and defaulting to ‘uncategorized’. It would be a nice feature to have work, as my contributors regularly forget to assign a category. But that doesn’t overshadow the usefulness of this great plugin, imo.

  11. hunk says:

    Hi kineta in the next version (1.4) I have rewritten this part

  12. Michael says:

    I have entered an image .. but only the URL shows up .. I have looks through this … I know it’s an easy fix .. I just am not a php guy .. any help ??

    Ps .. Love the Plugin !!

  13. hunk says:

    Hi Micheal use get_image(‘name_of_field’);

  14. Michael says:

    Is there a way to include a lightbox2 gallery in here .. with little thumbnails .. ?? Also .. when I use get_image(‘name_of_field’); it doesnt work .. maybe I am stupid .. I am using and this seems to work for me .. Can you be specific as I think my brain is really small .. Thanks ..

  15. Michael says:

    .. ps is blocked out my code that I put in the above post …

  16. Kineta says:

    Just updated to the new version and noticed that the category problem is fixed! Thank you so much for this wonderful plugin. It’s so useful!

  17. [...] esa mejora. La extensión no sólo destaca por su sobresaliente funcionalidad, sino por una excelente documentación (de hecho, existe un completísimo wiki en español sobre su uso), y en mi opinión constituirá [...]

  18. Chanon says:

    Guys, you rock!
    Thanks for the most handy cms plugin.

  19. daniel says:

    Great plugin, having one difficulty – I can only get one of my write fields when using the ‘get’ command

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    <?php
    echo get("wp_page_title"); // Content does NOT appear
    echo get("wp_page_content"); //Content does appear
    ?>

    Both fields are setup exactly the same as text fields etc, the code is in my page.php

    any suggestions? Thanks.

Leave a Reply

Stop SOPA