Skip to content

Commit

Permalink
Header/Footer added.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmad Awais committed Dec 2, 2015
1 parent 0b5a19f commit d5e03d6
Show file tree
Hide file tree
Showing 13 changed files with 261 additions and 64 deletions.
21 changes: 21 additions & 0 deletions assets/css/partials/_base.scss
@@ -0,0 +1,21 @@
/**
* Base SCSS
*/

.wrap{
display: table;
width: 100%;
height: 100%;
padding: 2vh;
background: $b;
color: $w;
font-size: 5vh;
}

.content{
display: table-cell;
width: 100%;
vertical-align: middle;
margin: 0 auto;
text-align: center;
}
31 changes: 17 additions & 14 deletions assets/css/style.scss
@@ -1,15 +1,15 @@
/**!
* Theme Name: WPGulpTheme
* Theme URI: https://github.com/ahmadawais/WPGulpTheme
* Description: A theme to demonstrate simplest implementation of WPGulp Boilerplate.
* Version: 1.0
* Author: Ahmad Awais, mrahmadawais
* Author URI: http://AhmadAwais.com/
* License: GNU General Public License v2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
* Tags: gulp, boilerpate
* Text Domain: wpgulp-theme
*/
Theme Name: WPGulpTheme
Theme URI: https://github.com/ahmadawais/WPGulpTheme
Description: A theme to demonstrate simplest implementation of WPGulp Boilerplate.
Version: 1.0
Author: Ahmad Awais, mrahmadawais
Author URI: http://AhmadAwais.com/
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: gulp, boilerpate
Text Domain: wpgulp-theme
*/

/* ----------------------------------------------------------------------------
* Mixins & Variables
Expand All @@ -20,13 +20,16 @@
/* ----------------------------------------------------------------------------
* Normalize & Santize
* ------------------------------------------------------------------------- */
@import "vendor/normalize";
@import "vendor/sanitize";
@import "vendors/normalize";
@import "vendors/sanitize";

/* ----------------------------------------------------------------------------
* Structure
* ------------------------------------------------------------------------- */
@import "partials/structure";

/* WPCore */
@import "partials/wpcore";
@import "partials/wpcore";

/* Base */
@import "partials/base";
8 changes: 8 additions & 0 deletions assets/js/custom.js
@@ -0,0 +1,8 @@
/**
* Custom JS.
*
* Custom JS scripts.
*
* @since 1.0.0
*/
console.log('CustomJS');
1 change: 1 addition & 0 deletions assets/js/custom.min.js
@@ -0,0 +1 @@
console.log("CustomJS");
16 changes: 16 additions & 0 deletions assets/js/vendors.js
@@ -0,0 +1,16 @@
/**
* Vendor JS 1.
*
* A vendor JS script.
*
* @since 1.0.0
*/
console.log('VendorJS1');
/**
* Vendor JS 2.
*
* A vendor JS script.
*
* @since 1.0.0
*/
console.log('VendorJS2');
1 change: 1 addition & 0 deletions assets/js/vendors.min.js
@@ -0,0 +1 @@
console.log("VendorJS1"),console.log("VendorJS2");
12 changes: 12 additions & 0 deletions footer.php
@@ -0,0 +1,12 @@
<?php
/**
* The template for displaying the footer.
*/
?>



<?php wp_footer(); ?>

</body>
</html>
77 changes: 59 additions & 18 deletions functions.php
Expand Up @@ -85,36 +85,77 @@ function neat_setup() {
*
* @since 1.0.0
*/
if (file_exists(dirname(__FILE__).'/assets/functions/aa_scripts_styles.php')) {
require_once( dirname(__FILE__).'/assets/functions/aa_scripts_styles.php' );
}


/**
* Widgets
*
* @since 1.0.0
* Scripts: Frontend with no conditions, Add Custom Scripts to wp_head
*
* @since 1.0.0
*
*/
if (file_exists(dirname(__FILE__).'/assets/functions/aa_widgets.php')) {
require_once( dirname(__FILE__).'/assets/functions/aa_widgets.php' );
add_action('wp_enqueue_scripts', 'aa_scripts');
function aa_scripts()
{
if ($GLOBALS['pagenow'] != 'wp-login.php' && !is_admin()) {


wp_enqueue_script('jquery'); // Enqueue it!
//wp_deregister_script('jquery'); // Deregister WordPress jQuery
//wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js', array(), '1.11.2');


/**
*
* Minified and concatenated scripts
*
* @vendors plugins.min,js
* @custom scripts.min.js
*
* Order is important
*
*/
wp_register_script('aa_vendorsJs', get_template_directory_uri() . '/assets/js/vendors.min.js'); // Custom scripts
wp_enqueue_script('aa_vendorsJs'); // Enqueue it!

wp_register_script('aa_customJs', get_template_directory_uri() . '/assets/js/custom.min.js'); // Custom scripts
wp_enqueue_script('aa_customJs'); // Enqueue it!

}

}


/**
* Extras: Custom functions that act independently of the theme templates.
*
* @since 1.0.0
* Styles: Frontend with no conditions, Add Custom styles to wp_head
*
* @since 1.0
*
*/
if (file_exists(dirname(__FILE__).'/assets/functions/aa_extras.php')) {
require_once( dirname(__FILE__).'/assets/functions/aa_extras.php' );
}
add_action('wp_enqueue_scripts', 'aa_styles'); // Add Theme Stylesheet
function aa_styles()
{

/**
*
* Minified and Concatenated styles
*
*/
wp_register_style('aa_style', get_template_directory_uri() . '/style.min.css', array(), '1.0', 'all');
wp_enqueue_style('aa_style'); // Enqueue it!

}

/**
* Template Functions for this theme.
*
* @since 1.0.0
* Comment Reply js to load only when thread_comments is active
*
* @since 1.0.0
*
*/
if (file_exists(dirname(__FILE__).'/assets/functions/aa_template_functions.php')) {
require_once( dirname(__FILE__).'/assets/functions/aa_template_functions.php' );
}
add_action( 'wp_enqueue_scripts', 'aa_enqueue_comments_reply' );
function aa_enqueue_comments_reply() {
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
18 changes: 13 additions & 5 deletions gulpfile.js
Expand Up @@ -53,7 +53,7 @@

var jsCustomSRC = './assets/js/custom/*.js';
var jsCustomDestination = './assets/js/';
var jsCustomFile = 'cutom';
var jsCustomFile = 'custom';


/**
Expand Down Expand Up @@ -82,11 +82,19 @@ gulp.task('styles', function () {
} ) )
.pipe( sourcemaps.write( { includeContent: false } ) )
.pipe( sourcemaps.init( { loadMaps: true } ) )
.pipe( autoprefixer('last 2 version', '> 1%', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4' ) )
.pipe( autoprefixer(
'last 2 version',
'> 1%',
'safari 5',
'ie 8',
'ie 9',
'opera 12.1',
'ios 6',
'android 4' ) )
.pipe( sourcemaps.write ( '.' ) )
.pipe( gulp.dest( styleDestination ) )
.pipe( filter( '**/*.css' ) ) // Filtering stream to only css files
.pipe( cmq() ) // Combines Media Queries

.pipe( rename( { suffix: '.min' } ) )
.pipe( minifycss( {
maxLineLen: 80
Expand All @@ -106,7 +114,7 @@ gulp.task( 'vendorsJs', function() {
.pipe( concat( jsVendorFile + '.js' ) )
.pipe( gulp.dest( jsVendorDestination ) )
.pipe( rename( {
basename: "vendors",
basename: jsVendorFile,
suffix: '.min'
}))
.pipe( uglify() )
Expand All @@ -125,7 +133,7 @@ gulp.task( 'customJS', function() {
.pipe( concat( jsCustomFile + '.js' ) )
.pipe( gulp.dest( jsCustomDestination ) )
.pipe( rename( {
basename: "vendors",
basename: jsCustomFile,
suffix: '.min'
}))
.pipe( uglify() )
Expand Down
17 changes: 17 additions & 0 deletions header.php
@@ -0,0 +1,17 @@
<?php
/**
* The header for our theme.
*
*/
?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">

<?php wp_head(); ?>
</head>

<body <?php body_class(); ?>>
15 changes: 14 additions & 1 deletion index.php
@@ -1,8 +1,21 @@
<?php
/**
* Index File
*/

get_header();

?>

<div class="wrap">
<div class="content">
<h1>WP Gulp Boilerplate!</h1>
<p>A simple to use gulp boilerplate for gulp beginners and WordPress developers.</p>
</div>
<!-- /.content -->
</div>
<!-- /.wrap -->
<!-- /.wrap -->



<?php get_footer(); ?>
45 changes: 19 additions & 26 deletions style.css

Large diffs are not rendered by default.

63 changes: 63 additions & 0 deletions style.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d5e03d6

Please sign in to comment.