README.md in edge_framework-0.10.0 vs README.md in edge_framework-1.0.0
- old
+ new
@@ -256,12 +256,12 @@
<div role="banner" class="show-for-large"></div>
// or
<div role="banner" class="hide-for-small"></div>
-TEMPLATE GENERATOR
-====================
+BOILERPLATE GENERATOR
+========================
Generate basic template for your project. Run this command inside your project directory:
1. Static HTML
@@ -269,16 +269,87 @@
2. Static PHP
`edge create php`
-3. Rails (run inside Rails project)
+3. Wordpress 3.8+ (Min PHP 5.3)
+ `edge create wordpress`
+
+4. Rails (run inside Rails project)
+
`rails g edge:install`
-4. Coming soon: Wordpress, Sinatra, and Flask
+5. Coming soon: Sinatra and Flask
+
+WORDPRESS
+====================
+
+![Edge Wordpress](http://cdn.setyono.net/edge/wp-edge.jpg)
+
+Features:
+
+- Auto add header and footer.
+- Independent from any plugin.
+- Cleaner WP Query call.
+- Easily create custom post type and taxonomy.
+
+Custom WP Query
+---------------------
+
+ Post::find()
+ get all posts.
+
+ Post::find($args_array)
+ get post(s) based on the arguments array.
+
+ Post::find_by($key, $value)
+ faster way of writing Post::find(array( $key => $value ))
+
+All of the functions above returns `WP_Query()` object. [Refer here](https://gist.github.com/luetkemj/2023628) for available argument.
+
+Example:
+
+ $posts = Post::find_by("category_name", "featured");
+
+ if( $posts->have_posts() ):
+ while( $posts->have_posts() ): $posts->the_post();
+ ...
+ endwhile;
+ endif;
+
+
+Custom Post Type
+--------------------
+
+ add_post_type( $name, <$icon>, <$taxonomy> )
+
+![Wordpress Custom Type](http://cdn.setyono.net/edge/wp-post-type.jpg)
+
+Inside `functions.php`, add these codes:
+
+ add_post_type("Product", "cart", "Brand");
+ add_post_type("Event", "calendar");
+
+All names must be **singular**. The icon name is taken from [melchoyce.github.io/dashicons/](http://melchoyce.github.io/dashicons/).
+
+To enable custom WP Query, create a class with the Post Type's name that extends `Post`.
+
+ // still inside functions.php
+ class Product extends Post {}
+ class Event extends Post {}
+
+Now, you can call the functions:
+
+ $products = Product::find_by("brand", "Microsoft")
+ $events = Event::find()
+
+The template file for custom post is `single-{slug}.php` while custom taxonomy is `taxonomy-{slug}.php`.
+
+Based on the example above, create `single-product.php` for single **Product** template. If we need to list all products within a brand, create `taxonomy-brand.php` which works the same way as `category.php`.
+
COMPASS
=================
![Edge Compass](http://cdn.setyono.net/edge/compass-edge.jpg)
@@ -318,13 +389,13 @@
$gutter : px
$total : int // total columns
Custom grid makes the markup cleaner and less duplication.
-It allows one additional sizing: **mini** which is below 480px on default. You can only set mini size when small size is specified.
+It allows one additional sizing: **mini** which is below 480px by default. You can only set mini size when small size is specified.
-Base class ("row" and "column") must be explicitly written.
+We still need to write the base class (`.row` and `.column`).
// HTML
<div class="row">
<aside class="column"></aside>
<main class="column"></main>
@@ -343,14 +414,12 @@
@include column($large: 10, $small: 8, $mini: 12);
}
**GUTTER**
-If you want to modify the global gutter, change it in Setting file.
+If you want to modify all the gutters, change it in Setting file. Otherwise, you must customize both row and column.
-But if you want it only on specific set of columns, apply it in both row and column.
-
// HTML
<div class="my-row row">
<aside class="column"></aside>
<main class="column"></main>
</div>
@@ -476,5 +545,6 @@
Template generator:
rails g edge:install
The command will give you Edge's SCSS files and append the pipeline.
+