Skip to content
This repository has been archived by the owner on Aug 5, 2022. It is now read-only.

matchboxdesigngroup/mdg-base-2014

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MDG Base is a WordPress starter theme based on Roots, which uses HTML5 Boilerplate & Bootstrap. It's here to help make better themes.

=== ###All Theme Dependencies/Tools Install Info ####Node.js

####Growl/Growl Notify ( optional for grunt-notify )

####Image Optim ( required for grunt-imageoptim ) ####Image Alpha ( required for grunt-imageoptim ) ####JPEG Mini ( optional for grunt-imageoptim )

####Homebrew

####RVM/Ruby

===

###Quick Start Prerequisites

  • Node.js
  • Bower
  • Composer

###Quick Start

  1. cd /path/to/mdg-base/
  2. chmod +x dev-assets/init.sh
  3. ./init.sh

=== ####PHP Documentation (work in progress) docs/php/index.html

=== ####JSDocs (work in progress)

=== ####Setup vHost (MAMP)

  1. Create file /Applications/MAMP/conf/apache/vhosts.conf

  2. Add a vHost to /Applications/MAMP/conf/apache/vhosts.conf

    # NOTE: Change *:80 to *:8888 if not using default apache ports
    # NOTE: Change Sitename to your sitename.extension, I suggest using sitename.dev
    <VirtualHost *:80>
    ServerName sitename.dev
    DocumentRoot /Applications/MAMP/htdocs/sitename
    <Directory /Applications/MAMP/sitename/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
    </Directory>
    </VirtualHost>
    
  3. Include vhosts.conf in /Applications/MAMP/conf/apache/http.conf

    # NOTE: Change *:80 to *:8888 if not using default apache ports
    NameVirtualHost *:80
    Include /Applications/MAMP/conf/apache/vhosts.conf
    
  4. Add site to /etc/hosts with nano, vim, or other editor 127.0.0.1 sitename.dev

  5. Restart server

  6. Access site at http://sitename.dev

  7. To add more sites duplicate steps 2(add vHost) and 4(add site to hosts)

=== ####Query Examples

#####Default WP_Query

$custom_query_args = array(
	'post_type'      => $this->post_type,
	'posts_per_page' => -1,
	'post_status'    => 'publish',
	'order'          => 'DESC',
	'orderby'        => 'date',
);
$custom_query = new WP_Query( $custom_query_args );
$custom       = $custom_query->get_posts();

#####MDG_Custom_Post_Type Query

  • Builds in transient caching
  • Returns the exact same data as the default WP_Query above.
  • Should not be used with orderby random or if you are using a drag/drop sorting plugin when using orderly menu_order
// Default
global $mdg_custom_post_type;
$custom_query_args = array();
$custom            = $mdg_custom_post_type->get_posts( $custom_query_args );

// Custom Arguments (Accepts anything that WP_Query does)
$custom_query_args = array(
	'posts_per_page' = 10,
);
$custom = $mdg_custom_post_type->get_posts( $custom_query_args ); // Returns the last 10 posts

=== ####Custom Meta Example(work in progress)

global $my_post_type;

// Retrieves all the current posts meta.
$all_post_meta    = $my_post_type->get_post_meta();

// Retrieves a single post meta value
$single_post_meta = $my_post_type->get_post_meta();

// Then you can use extract() and have quick access to the meta using the meta id minus the post type and lower case
// if the meta id = posttype_meta_key then the variable will be $meta_key;
extract( $all_post_meta );
extract( $single_post_meta );

// You can use pp() to check what meta this post has.
pp( $all_post_meta );

===

###Folder Sturcutre

├── assets
│   ├── bower_components (Bower componenets)
│   ├── css (Minified production CSS files)
│   │   └── scss
│   │       ├── admin (SCSS for wp-admin styles)
│   │       ├── plugins (SCSS for plugins not managed by bower)
│   │       └── site (SCSS for front end styles)
│   ├── fonts (@font-face fonts)
│   ├── img (Front end images)
│   │   ├── admin (Images for use in wp-admin)
│   │   └── plugins (Images for plugins not managed by bower)
│   └── js (Minified production JavaScript files)
│       ├── src (All JavaScript source files)
│       │   ├── admin (JavaScript for wp-admin)
│       │   ├── plugins (JavaScript/jQuery plugins/libs not maintained by bower)
│       │   └── site (JavaScript for the front end)
│       └── vendor (External Javascript not concatenated into site.min.js)
├── classes (Post Type base classes and other helper classes)
├── dev-assets (Storage for files used during development)
├── lang (Language local files)
├── lib (Configuration)
└── templates (Content templates)