Skip to content
This repository has been archived by the owner on May 16, 2021. It is now read-only.

Commit

Permalink
Launch of theme
Browse files Browse the repository at this point in the history
  • Loading branch information
benbrehaut committed Dec 10, 2016
0 parents commit f7d09ea
Show file tree
Hide file tree
Showing 31 changed files with 1,128 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
*.log
.tmp/
*.sql
*.sql.gz
.sass-cache/
*.css.map
.vscode
node_modules/*
28 changes: 28 additions & 0 deletions 404.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
/**
* The template for displaying 404 pages (not found)
*
* @package WordPress
* @subpackage halos
* @since 1.0
* @version 1.0
*/
get_header();
?>

<section class="error-page">
<header class="error-page__header">
<h1>404 - File not Found</h1>
</header>
<div class="error-page__content">
<p>The page you are looking for might have been removed, had its name changed or is unavailable.</p>
<p>If you are still stuck, please try some of these suggestions.</p>
<ul>
<li>Check your spelling.</li>
<li>Return to the <a href="<?php echo esc_url( home_url( '/' ) ); ?>">home page</a></li>
<li>Go back to your <a href="javascript:history.back()">last page</a></li>
</ul>
</div>
</section>

<?php get_footer();
100 changes: 100 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
module.exports = function(grunt) {

// Grunt configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),

// Concat Task
concat: {
dist: {
src: [
'assets/js/libs/**/*.js', // all js vendor files
'assets/js/main.js' // the main js file
],
dest: 'assets/js/scripts.js', // concat it into one file
},
},
// End Concat Task

// Uglify Task
uglify: {
build: {
src: 'assets/js/scripts.js', // take our concation file.
dest: 'assets/js/scripts.min.js' // output out and minify it.
}
},
// End Uglify Task

// Sass Task
sass: {
options: {
sourceMap: true,
outputStyle: 'compressed'
},
dist: {
files: {
'assets/css/style.css': 'assets/scss/style.scss'
}
},
},
// End Sass Task

// Autoprefixer (PostCSS) Task
postcss: {
options: {
map: true,
processors: [
require('autoprefixer')({
browsers: ['last 25 versions']
})
]
},
dist: {
src: 'assets/css/style.css'
}
},
// End Autoprefixer Task


// Watch Task
watch: {
options: {
dateFormat: function(time) {
grunt.log.writeln('Finished in ' + time + 'ms at ' + (new Date()).toString());
grunt.log.writeln('Waiting for more changes...');
},
// Live Reload
// livereload: {
// options: { livereload: false },
// files: ['assets/**/*'],
// },
},
scripts: {
files: 'assets/js/main.js', // main js file that is being worked on.
tasks: ['concat', 'uglify'],
},
css: {
files: 'assets/scss/**/*.scss',
tasks: ['sass','postcss'],
},
},
// End Watch


// End Grunt Config
});

// Time Grunt
require('time-grunt')(grunt);

// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-postcss');
grunt.loadNpmTasks('grunt-contrib-watch');

// Default task(s).
grunt.registerTask('default', ['concat', 'uglify', 'sass', 'watch']);

};
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Halos

## Introduction
A starter theme for WordPress to create the next awesome custom theme for a client!

The purpose of these theme is to be a starting point for theme creation on build projects, reducing the time of removing parts of removing parts of other themes which we don't need, and adding our own. Simpley put, it should allow a developer to dive deep into the build project.

## Requirements
* [Node.js](https://nodejs.org/en/)
* [Grunt](http://www.gruntjs.com)
* [Sass](http://www.sass-lang.com)

## How to build
1. Clone this repo and place within your 'wp-content/themes' folder.
````
$ cd wp-project-folder/wp-content/themes
$ git clone github.com/benbrehaut/halos.git
$ cd halos
````
2. While within the theme root, run;
````
npm install
grunt
````

### Styles
All Sass files are located within ``assets/scss``, with the ``style.scss`` outputting into ``assets/css/style.css`` This can be changed with ``Grunt.js`` file if you wish, but is probably best to keep it to this default location.

* ``style.css`` is blank on purpose, and is required by WordPress to register this as a theme.
* ``assets/scss/style.scss`` is our main stylesheet, which will compile everything inside it into ``assets/css/style.css``

### Scripts
All JavaScript files are located with ``assets/js``, the ``main.js`` file is the main Javascript file for the theme, with external third party libraries within the ``libs`` folder. All files within this will be concatenated into the ``scripts.js`` file, includeding the ``main.js`` file, which is then concatenated and compressed into ``scripts.min.js``

* ``assets/js/main.js`` is the main JavaScript file. This is where you should write all of your JavaScript.
* ``assets/js/scripts.js`` is the uncompressed and concatenated JavaScript file from all of the files within the ``assets/js/libs/*.js`` folder and ``assets/js/main.js`` file.
* ``assets/js/scripts.min.js`` is our compressed version of the ``assets/js/scripts.js`` file.
36 changes: 36 additions & 0 deletions archive.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php
/**
* The template for displaying archive pages
*
* Used to display archive-type pages if nothing more specific matches a query.
* For example, puts together date-based pages if no date.php file exists.
*
* If you'd like to further customize these archive views, you may create a
* new template file for each one. For example, tag.php (Tag archives),
* category.php (Category archives), author.php (Author archives), etc.
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage halos
* @since 1.0
* @version 1.0
*/

get_header();
?>

<?php
if ( have_posts() ) :

/* Start the Loop */
while ( have_posts() ) : the_post();

get_template_part('template-partials/post');

endwhile;

endif;
?>

<?php get_footer();
2 changes: 2 additions & 0 deletions assets/css/style.css

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

10 changes: 10 additions & 0 deletions assets/js/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
$(function() {
// Start jQuery

/*
* Console log that DOM is ready.
*/
console.info( "DOM ready" );

// End jQuery
});
10 changes: 10 additions & 0 deletions assets/js/scripts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
$(function() {
// Start jQuery

/*
* Console log that DOM is ready.
*/
console.info( "DOM ready" );

// End jQuery
});
1 change: 1 addition & 0 deletions assets/js/scripts.min.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$(function(){console.info("DOM ready")});
11 changes: 11 additions & 0 deletions assets/scss/style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
Theme Name: halos
Theme URI: https://www.haloassociates.co.uk/
Github Theme URI: https://github.com/benbrehaut/halos/
Description: halos is a base theme, for the purpose of creating custom theme for client projects.
Version: 1.0
Author: Ben Brehaut
Author URI: http://benb.uk/
License: MIT License
License URI: http://www.opensource.org/licenses/mit-license.php
*/
79 changes: 79 additions & 0 deletions comments.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?php
/**
* The template for displaying comments
*
* This is the template that displays the area of the page that contains both the current comments
* and the comment form.
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage halos
* @since 1.0
* @version 1.0
*/

/*
* If the current post is protected by a password and
* the visitor has not yet entered the password we will
* return early without loading the comments.
*/
if ( post_password_required() ) {
return;
}
?>

<section id="comments" class="post-comments">

<?php
// You can start editing here -- including this comment!
if ( have_comments() ) : ?>
<h2 class="comments-title">
<?php
$comments_number = get_comments_number();
if ( '1' === $comments_number ) {
/* translators: %s: post title */
printf( _x( 'One Reply to &ldquo;%s&rdquo;', 'comments title', 'halos' ), get_the_title() );
} else {
printf(
/* translators: 1: number of comments, 2: post title */
_nx(
'%1$s Reply to &ldquo;%2$s&rdquo;',
'%1$s Replies to &ldquo;%2$s&rdquo;',
$comments_number,
'comments title',
'twentyseventeen'
),
number_format_i18n( $comments_number ),
get_the_title()
);
}
?>
</h2>

<ol class="comment-list">
<?php
wp_list_comments( array(
'avatar_size' => 100,
'style' => 'ol',
'short_ping' => true,
'reply_text' => __( 'Reply', 'halos' ),
) );
?>
</ol>

<?php

endif; // Check for have_comments().

// If comments are closed and there are comments, let's leave a little note, shall we?
if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : ?>

<p class="no-comments"><?php _e( 'Comments are closed.', 'halos' ); ?></p>
<?php
endif;

comment_form();
?>

</section><!-- #comments -->
37 changes: 37 additions & 0 deletions footer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php
/**
* The footer for our theme
*
* This is the template that displays the ending of the page
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package WordPress
* @subpackage halos
* @since 1.0
* @version 1.0
*/

?>
</main>
<!-- site-content -->

<!-- site-footer -->
<footer class="site-footer" role="contentinfo">
<div class="site-footer__col">
<?php
wp_nav_menu( array(
'theme_location' => 'site-footer-nav',
'container' => false,
'fallback_cb' => false // Do not fall back to wp_page_menu()
) );
?>
</div>
<div class="site-footer__copy">
&copy; <?php echo date("Y"); ?>
</div>
</footer>
<!-- /site-footer -->

<?php wp_footer(); ?>
</body>
Loading

0 comments on commit f7d09ea

Please sign in to comment.