Giter VIP home page Giter VIP logo

acf-widgets's Introduction

ACF Widgets

ACF Widgets (ACFW) allows users to easily create widgets to use with ACF. With ACFW, you can easily create new widgets without touching any code. No PHP classes or dealing with the Widgets API. After you create a widget, you can assign custom fields within ACF and then use theme templates to easily show the custom fields.

Install:

  • Make sure the latest version of ACF Pro is installed and updated. At the time of this writing, that's 5.2.9
  • Upload the .zip from the Plugins menu inside of Wordpress or the unzipped files via S/FTP
  • Activate the Plugin
  • Click on the new admin menu item called "Add New Widgets" located in the "Appearances" menu.
  • Create a new "Widget".
  • Create a new field group in ACF. Assign it to the type, "widget" -> "Your widget name".
  • Add any fields you want to attach to your new widget.
  • Add the widget to a sidebar and fill in your fields.
  • Create a new file in your theme directory named widget-mycool-slug.php. Alternatively, you can name the template file widget-id.php where id is the post id of the widget. (note: widget- must be prefixed before the slug of your widget name.)
  • NEW! Copy one of the convenient templates from the "templates" directory included in this plugin to your theme folder.
  • In your newly created template files, call the fields using the normal methods. See http://www.advancedcustomfields.com/resources/get-values-widget/ for more info.
  • Example. <?php the_field( 'custom_field', $acfw ); ?> The $acfw variable is automatically mapped for you to use.
  • NEW! Template debugging. Navigate to "Settings > ACFW Options" and check the box under debugging. On the front end of your site, any active widgets will tell you what template they are looking for.

That's it!

If you're interested, the normal filters are still available like $before and $after widget.

Those with a license can get support from the Official ACFW Support Forums. Priority support is also available for those holding a "Developer" license of the plugin.

If you're interested in translating, open an issue and we'll work something out :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.