Code Monkey home page Code Monkey logo

kacf's Introduction

KACF

Dependencies

Recommended Plugins

  • ACF Extended : This plugin allows you to see the local ACF fields and insert them directly into your database

KACF : What and why ?

The goal of KACF is to simplify the creation and duplication of blocks in multiple websites.

Once your block has been created in one site, you can reuse it in another site by simply copying and pasting the block folder into your new theme.

Installation

KACF full theme

  • Clone or download the directory
  • Customize it by modifying /screenshot.png, /style.css.

KACF only

  • Download the folder /lib/kacf/ and insert it in your lib folder.
  • Create the folder /gutenberg/ in your theme directory.
  • Add the lines below in the functions.php file:
require dirname(__FILE__) . '/lib/kacf/kacf.inc.php';
new kacf();

There are some options in the KACF class to customize the architecture of your theme.

new kacf(
  $gutpath = '/gutenberg/', // path of your gutenberg folder
  $add_hooks = true, // add action and filter to launch the KACF class
  $relative_paths = array(
    'php' => 'template.php', // php template path inside the block folder
    'css' => 'less/index.php', // css path inside the block folder
    'js' => 'js/script.js', // js path inside the block folder
    'acf' => 'acf/acf.php' // acf path inside the block folder
  ),
  $unregister_default_blocks = true // unregister the WP core blocks
);

Block creation

  • Copy the /gutenberg/_base folder and rename it as follows: /gutenberg/myblock/.
  • Add a title (and other information if necessary) in the comments of the /gutenberg/myblock/template.php file header.
  • Export the PHP block code creation (available in the ACF administration interface).
  • Import it in the file /gutenberg/myblock/acf/acf.php.
  • It's done.

Block duplication

  • Copy the /gutenberg/myblock folder and from another site and past it into your own /gutenber/ folder.
  • It's done.

kacf's People

Contributors

kiitoss avatar

Stargazers

Idriss avatar

Watchers

 avatar

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.