Home Forums General Issues For a newbee


For a newbee

  • 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’);

  • Hi Jonathan
    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.
    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

  • Thanks Jonathan
    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.


Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘For a newbee’ is closed to new replies.