README.md in edge_framework-1.3.3 vs README.md in edge_framework-1.3.5

- old
+ new

@@ -283,54 +283,30 @@ 2. Wordpress 3.8+ (Min PHP 5.3) `edge create wordpress` -3. Rails (run inside Rails project) +3. Ghost Blog + `edge create blog` + +4. Rails (run inside Rails project) + `rails g edge:install` -4. Coming soon: Sinatra and Flask +5. Coming soon: Sinatra and Flask WORDPRESS ==================== ![Edge Wordpress](http://cdn.setyono.net/edge/wp-edge.jpg) -Features: +Our WordPress template requires [Timber](http://upstatement.com/timber/). It is a template engine that separates PHP and HTML into their own file. -- Auto add header and footer. -- Independent from any plugin. -- Cleaner WP Query call. -- Easily create custom post type and taxonomy. +So, download and include [its plugin](https://wordpress.org/plugins/timber-library/) into your WordPress installation. -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 -------------------- ![Wordpress Custom Type](http://cdn.setyono.net/edge/wp-post-type.jpg) @@ -341,40 +317,14 @@ add_post_type("Product", "cart", "Brand"); add_post_type("Event", "calendar"); 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`. +Tips: - // still inside functions.php +- If you want pagination to work, the `$name` cannot be the same as any page's slug. - class Product extends Post {} - class Event extends Post {} - -Now, you can use the custom WP Query: - - $products = Product::find_by("brand", "Microsoft") - $events = Event::find() - -**Alert**: If you want pagination to work, the Name cannot be the same as any page's slug. - -Template File ---------------- - -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`. - -Naming Convention ------------------ - -All names must be **singular**. - -No special character except space. If contain space, the class' name should be its combined word and no camel casing. - - add_post_type("Photo Gallery", "format-gallery"); - - class Photogallery extends Post {} +- All type's name and taxonomy's name must be **singular** and no special character except space. COMPASS ================= ![Edge Compass](http://cdn.setyono.net/edge/compass-edge.jpg)