I am trying to write my first plugin and to get ACF5 work with one field named “fotograf” in a field group called “Fotoinformation” BUT i really don’t get it.
1. How to display a field the easiest way possible
2. How to write the easiest possible plugin to display a field.
Nor does the shortcode work, sp perhaps something is not working as expected or i do not understand how it should work. In my mind a shortcode should display the field by simply adding the code to a post? Does it has to be enabled in some way more then activating the plugin?
May I ask why you’re writing a plugin simply to display an acf field?
Since ACF fields is pretty much site dependent why not do this directly in the themes files?
The easiest way to display a field (a directly saved value, not an array) is with the_field(‘field_name’);
Well my reason maybe not be correct, but i will create a service with multisite where each customer can have there own theme. So i was thinking of making a plugin to add the fields. Wright or wrong i don’t know.
Still i have not managed to display any field yet. I tried this syntax in several ways, also added the short code to a post. But no result.
this is my syntax <?php the_field(‘fotograf’); ?>
I even tried this but do not succeed. http://vimeo.com/21468614
I don’t get it.or something is broken.
you probably cant do the_field inside a plugin unless you’re absolutely sure it loads after ACF.. I’m not too sure about it..
Perhaps you should look at some existing plugins to help you out instead 🙂
Seriously powerful which I use on most networks which have multiple sites with the same basic setup
Let users switch theme after registration
I am more of a builder than a programmer, sp i need things to work simple for me.
Maybe i have to understand wordpress better to understand how to make it working.
Still wonder why there is a function called short code in ACF5
Also from Elliot, this may be the solution.
The topic ‘For a newbee’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!