diff --git a/wp-content/themes/aktiv2014/404.php b/wp-content/themes/aktiv2014/404.php index eee0752..c66d3aa 100644 --- a/wp-content/themes/aktiv2014/404.php +++ b/wp-content/themes/aktiv2014/404.php @@ -5,7 +5,7 @@
>

404: Denne siden er på grisefest

- +

Lykke til videre.

diff --git a/wp-content/themes/aktiv2014/app/404.php b/wp-content/themes/aktiv2014/app/404.php new file mode 100644 index 0000000..eee0752 --- /dev/null +++ b/wp-content/themes/aktiv2014/app/404.php @@ -0,0 +1,18 @@ + + +
> + +

404: Denne siden er på grisefest

+ +
+

Lykke til videre.

+
+ +
+ + + + + diff --git a/wp-content/themes/aktiv2014/app/footer.php b/wp-content/themes/aktiv2014/app/footer.php new file mode 100644 index 0000000..2f603df --- /dev/null +++ b/wp-content/themes/aktiv2014/app/footer.php @@ -0,0 +1,13 @@ + + + +
+
Laget med ♥ av KAK
+
+ + + + + diff --git a/wp-content/themes/aktiv2014/app/functions.php b/wp-content/themes/aktiv2014/app/functions.php new file mode 100644 index 0000000..52d09b4 --- /dev/null +++ b/wp-content/themes/aktiv2014/app/functions.php @@ -0,0 +1,373 @@ + __( 'Hovedmeny' ) ) + ); +} +add_action( 'init' , 'neuf_register_nav_menus' ); + +/** + * Enqueue various scripts we use. + */ +function neuf_enqueue_scripts() { + // enqueue the scripts + wp_enqueue_script( 'jquery' ); + wp_enqueue_script( 'underscore' ); + +} +add_action( 'wp_enqueue_scripts' , 'neuf_enqueue_scripts' ); + +/** + * Force large uploaded images. + * + * Denies uploads of images smaller (in pixels) than given width and height values. + */ +function neuf_handle_upload_prefilter( $file ) { + $width = 640; + $height = 480; + + $img = getimagesize( $file['tmp_name'] ); + $minimum = array( 'width' => $width , 'height' => $height ); + $width = $img[0]; + $height =$img[1]; + + if ( $width < $minimum['width'] ) + return array( "error" => "Image dimensions are too small. Minimum width is {$minimum['width']}px. Uploaded image width is $width px" ); + + elseif ($height < $minimum['height']) + return array( "error" => "Image dimensions are too small. Minimum height is {$minimum['height']}px. Uploaded image width is $width px" ); + else + return $file; +} +// Commenting out for testing purposes +add_filter( 'wp_handle_upload_prefilter' , 'neuf_handle_upload_prefilter' ); + +/** + * Adds more semantic classes to WP's post_class. + * + * Adds these classes: + * i) a class with a page-wide post count. The first post on this page is named .p1, the second p2 and so forth. + * ii) a class 'alt' to every other post. + */ +function neuf_post_class( $classes = '' ) { + global $neuf_pagewide_post_count; + + if ( $classes ) + $classes = array ( $classes ); + + $classes[] = 'p' . ++$neuf_pagewide_post_count; + + if ( 0 == $neuf_pagewide_post_count % 2 ) + $classes[] = 'alt'; + + $classes = join( ' ' , $classes ); + + post_class( $classes ); +} + +/* Gets nicely the regular and member price nicely formated */ +function neuf_get_price( $neuf_event ) { + $price_regular = get_post_meta( $neuf_event->ID , '_neuf_events_price_regular' , true ); + $price_member = get_post_meta( $neuf_event->ID , '_neuf_events_price_member' , true ); + if ( $price_regular ) { + if ( $price_member ) + $cc = "$price_regular/$price_member"; + else + $cc = $price_regular; + } else + $cc = ''; + + return $cc; +} + +/** + * Adds more semantic classes to WP's body_class. + * + * Adds these classes: + * i) For pages, adds 'page-slug' + */ +function neuf_body_class( $classes = '' ) { + global $post; + + if ( $classes ) + $classes .= ' '; + + if ( is_page() ) + $classes .= 'page-' . $post->post_name ; + + body_class( $classes ); +} + + +/** + * Determines what to display in our title element. + * + * Most of this borrowed from the Thematic theme framework. + */ +function neuf_doctitle() { + $site_name = get_bloginfo( 'name' ); + $separator = '|'; + + if ( is_single() ) { + $content = single_post_title( '' , false ); + + } elseif ( is_home() || is_front_page() ) { + $content = get_bloginfo( 'description' ); + + } elseif ( is_page() ) { + $content = single_post_title( '' , false ); + + } elseif ( is_search() ) { + $content = __( 'Søkeresultater for', 'neuf-web' ); + $content .= ' ' . esc_html(stripslashes(get_search_query())); + + } elseif ( is_category() ) { + $content = __( 'Arkiv for kategorien' , 'neuf-web' ); + $content .= ' ' . single_cat_title( "" , false );; + + } elseif ( is_tag() ) { + $content = __( 'Arkiv for stikkordet' , 'neuf-web' ); + $content .= ' ' . neuf-web_tag_query(); + + } elseif ( is_404() ) { + $content = __( 'Ikke funnet', 'neuf-web' ); + + } else { + $content = get_bloginfo( 'description' ); + } + + if ( get_query_var( 'paged' ) ) { + $content .= ' ' .$separator. ' '; + $content .= 'side'; + $content .= ' '; + $content .= get_query_var('paged'); + } + + if($content) { + if ( is_home() || is_front_page() ) { + $elements = array( + 'site_name' => $site_name, + 'separator' => $separator, + 'content' => $content + ); + } else { + $elements = array( + 'content' => $content, + 'separator' => $separator, + 'site_name' => $site_name + ); + } + } else { + $elements = array( + 'site_name' => $site_name + ); + } + + $doctitle = implode(' ', $elements); + + $doctitle = "\t" . "" . $doctitle . "" . "\n\n"; + + echo $doctitle; +} // end neuf_doctitle + + + +/** + * Display social sharing buttons + */ +function display_social_sharing_buttons() { ?> +
+
+ + +
+
+
+
+
+ $post->ID, + 'post_type' => 'any', + 'numberposts' => -1, + 'post_status' => 'any' + ) ); + + return count( $attachments ); +} + +/** + * Displays a gallery if suitable (Template Tag). + * + * If a post has more than two attachments, we should probably display them in + * single view. This particularly applies to events. Photos of concerts etc. + * can this way easily be added after the event, without much hassle. + * + * @author misund + */ +function neuf_maybe_display_gallery() { + if ( 2 < neuf_get_attachment_count() ) + echo do_shortcode( '[gallery]' ); +} + +/** + * Trims $text down to $length words. + * If $text is truncated, then "[..]" is appended. + */ +function trim_excerpt($text, $length) { + $org_length = strlen($text); + $text = explode(" ", $text); // word boundary + $text = array_slice($text, 0, $length); + $text = implode(" ", $text); + $shorter = $org_length != strlen($text) ? " [...]" : ""; + return $text . $shorter; +} + +/** + * Replaces the matching $pattern with $replacement in the string $subject. + */ +function linkify($subject, $pattern, $link) { + $replacement = '[...]'; + $output = preg_replace($pattern, $replacement, $subject); + return $output; +} + +/** + * Builds and displays suitable page titles. + * + * Original author: Ian Stewart (theme Thematic). + */ +function neuf_page_title() { + + global $post; + + $content = ''; + if (is_attachment()) { + $content .= '

Tilbake til '; + $content .= get_the_title($post->post_parent); + $content .= '

'; + } elseif (is_author()) { + $content .= '

'; + $author = get_the_author_meta( 'display_name' ); + $content .= __('Innhold skrevet av', 'neuf'); + $content .= ' '; + $content .= $author; + $content .= '

'; + } elseif (is_category()) { + $content .= '

'; + $content .= __('Innhold i kategorien', 'neuf'); + $content .= ' '; + $content .= single_cat_title('', FALSE); + $content .= '

' . "\n"; + $content .= '
'; + if ( !(''== category_description()) ) : $content .= apply_filters('archive_meta', category_description()); endif; + $content .= '
'; + } elseif (is_search()) { + $content .= '

'; + $content .= __('Søkeresultater for:', 'neuf'); + $content .= ' '; + $content .= esc_html(stripslashes($_GET['s'])); + $content .= '

'; + } elseif (is_tag()) { + $content .= '

'; + $content .= __('Innhold merket med', 'neuf'); + $content .= ' '; + $content .= __(neuf_tag_query()); + $content .= '

'; + } elseif (is_tax()) { + global $taxonomy; + $content .= '

'; + $tax = get_taxonomy($taxonomy); + $content .= $tax->labels->name . ' '; + $content .= __('Arkiv:', 'neuf'); + $content .= ' '; + $content .= neuf_get_term_name(); + $content .= '

'; + } elseif (is_day()) { + $content .= '

'; + $content .= sprintf(__('Innhold fra dagen %s', 'neuf'), get_the_time(get_option('date_format'))); + $content .= '

'; + } elseif (is_month()) { + $content .= '

'; + $content .= sprintf(__('Innhold fra måneden %s', 'neuf'), get_the_time('F Y')); + $content .= '

'; + } elseif (is_year()) { + $content .= '

'; + $content .= sprintf(__('Innhold fra året %s', 'neuf'), get_the_time('Y')); + $content .= '

'; + } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { + $content .= '

'; + $content .= __('Arkiv', 'neuf'); + $content .= '

'; + } + $content .= "\n"; + echo( $content ); +} + +/** + * Creates nice multi_tag_title. + * + * Original author: Martin Kopischke. + */ + +function neuf_tag_query() { + $nice_tag_query = get_query_var('tag'); // tags in current query + $nice_tag_query = str_replace(' ', '+', $nice_tag_query); // get_query_var returns ' ' for AND, replace by + + $tag_slugs = preg_split('%[,+]%', $nice_tag_query, -1, PREG_SPLIT_NO_EMPTY); // create array of tag slugs + $tag_ops = preg_split('%[^,+]*%', $nice_tag_query, -1, PREG_SPLIT_NO_EMPTY); // create array of operators + + $tag_ops_counter = 0; + $nice_tag_query = ''; + + foreach ($tag_slugs as $tag_slug) { + $tag = get_term_by('slug', $tag_slug ,'post_tag'); + // prettify tag operator, if any + if ($tag_ops[$tag_ops_counter] == ',') { + $tag_ops[$tag_ops_counter] = ', '; + } elseif ($tag_ops[$tag_ops_counter] == '+') { + $tag_ops[$tag_ops_counter] = ' + '; + } + // concatenate display name and prettified operators + $nice_tag_query = $nice_tag_query.$tag->name.$tag_ops[$tag_ops_counter]; + $tag_ops_counter += 1; + } + return $nice_tag_query; +} + +/** + * Gets the name of a term. + * + * Original author: Justin Tadlock (theme Hybrid). + */ +function neuf_get_term_name() { + $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); + return $term->name; +} + +?> diff --git a/wp-content/themes/aktiv2014/app/header.php b/wp-content/themes/aktiv2014/app/header.php new file mode 100644 index 0000000..fcb82f4 --- /dev/null +++ b/wp-content/themes/aktiv2014/app/header.php @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + +> + +
+ + diff --git a/wp-content/themes/aktiv2014/app/images/fat-pig1.jpg b/wp-content/themes/aktiv2014/app/images/fat-pig1.jpg new file mode 100644 index 0000000..5a089ee Binary files /dev/null and b/wp-content/themes/aktiv2014/app/images/fat-pig1.jpg differ diff --git a/wp-content/themes/aktiv2014/app/index.php b/wp-content/themes/aktiv2014/app/index.php new file mode 100644 index 0000000..503a43c --- /dev/null +++ b/wp-content/themes/aktiv2014/app/index.php @@ -0,0 +1,32 @@ + +
+

+ +LOL2 + + +
> +
+ +

+ + + + + + + +
+ +
+ + + +
+
+ + + +
+ + diff --git a/wp-content/themes/aktiv2014/app/menu.php b/wp-content/themes/aktiv2014/app/menu.php new file mode 100644 index 0000000..be2c6fa --- /dev/null +++ b/wp-content/themes/aktiv2014/app/menu.php @@ -0,0 +1,7 @@ + diff --git a/wp-content/themes/aktiv2014/app/page-front-page.php b/wp-content/themes/aktiv2014/app/page-front-page.php new file mode 100644 index 0000000..dc18ff3 --- /dev/null +++ b/wp-content/themes/aktiv2014/app/page-front-page.php @@ -0,0 +1,19 @@ + + + + + + +
+
+ + + + +
+ + diff --git a/wp-content/themes/aktiv2014/app/scripts/main.js b/wp-content/themes/aktiv2014/app/scripts/main.js index 20ca76d..80d83e9 100644 --- a/wp-content/themes/aktiv2014/app/scripts/main.js +++ b/wp-content/themes/aktiv2014/app/scripts/main.js @@ -1 +1 @@ -console.log('\'Allo \'Allo!'); \ No newline at end of file +console.log('\'Allo \'Allo!'); diff --git a/wp-content/themes/aktiv2014/app/sidebar.php b/wp-content/themes/aktiv2014/app/sidebar.php new file mode 100644 index 0000000..51b6ade --- /dev/null +++ b/wp-content/themes/aktiv2014/app/sidebar.php @@ -0,0 +1,4 @@ + + diff --git a/wp-content/themes/aktiv2014/app/styles/main.scss b/wp-content/themes/aktiv2014/app/styles/main.scss index 4e830b8..2ee492b 100644 --- a/wp-content/themes/aktiv2014/app/styles/main.scss +++ b/wp-content/themes/aktiv2014/app/styles/main.scss @@ -1,28 +1,95 @@ +@import 'normalize'; + +//$primary-color: #ff0; +//$secondary-color: #0f0; + +@import "foundation/components/grid"; +@import "foundation/components/block-grid"; +@import "foundation/components/visibility"; +@import "foundation/components/type"; + body { background: #fafafa; - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - color: #444; + font-family: "Open Sans", sans-serif; + color: #000; } +#site-header { + padding-top: rem-calc(16); + padding-bottom: rem-calc(16); + background-color: #111; -.hero-unit { - margin: 50px auto 0 auto; - width: 300px; - font-size: 18px; - font-weight: 200; - line-height: 30px; - background-color: #eee; - border-radius: 6px; - padding: 60px; - h1 { - font-size: 60px; + #header-container { + @include grid-row(); + position: relative; + } +} +.site-title { + float: left; + padding-left: rem-calc(16); +} +#menu { + float: right; + padding-right: rem-calc(50); + + .menu-toggle { + display: none; + position: absolute; + right: rem-calc(16); + } + ul { + list-style: none; + padding: 0; + margin: 0; line-height: 1; - letter-spacing: -1px; + li { + display: block; + float: left; + padding-right: rem-calc(20); + + &:last-child { + padding-right: 0; + } + } } } -.browsehappy { - margin: 0.2em 0; - background: #ccc; - color: #000; - padding: 0.2em 0; +#content { + @include grid-row(); + margin-top: rem-calc(16); + .introduction { + padding-left: rem-calc(16); + } +} +.love { + color: #faafba; +} +.credits-wrap { + @include grid-row(); + + .credits { + margin-top: 25px; + margin-bottom: 25px; + @include grid-column(12); + text-align: center; + color: #666; + font-size: rem-calc(12); + } +} +/* Single */ +#content { + .page-title, + .page, + .post { + padding-left: rem-calc(16); + } +} +.entry-meta { + margin-bottom: rem-calc(10); +} + +/* Overrides */ +.vcard { + margin: 0; + border: 0; + padding: 0; } diff --git a/wp-content/themes/aktiv2014/bower.json b/wp-content/themes/aktiv2014/bower.json index 06c78e8..04f7c66 100644 --- a/wp-content/themes/aktiv2014/bower.json +++ b/wp-content/themes/aktiv2014/bower.json @@ -3,7 +3,12 @@ "private": true, "dependencies": { "modernizr": "~2.6.2", - "jquery": "~1.11.0" + "jquery": "~1.11.0", + "foundation": "~5.3.0" }, - "devDependencies": {} + "devDependencies": {}, + "resolutions": { + "modernizr": ">= 2.7.2", + "jquery": ">= 2.1.0" + } } diff --git a/wp-content/themes/aktiv2014/gulpfile.js b/wp-content/themes/aktiv2014/gulpfile.js index a182086..26fc400 100644 --- a/wp-content/themes/aktiv2014/gulpfile.js +++ b/wp-content/themes/aktiv2014/gulpfile.js @@ -3,17 +3,37 @@ var gulp = require('gulp'); + // load plugins var $ = require('gulp-load-plugins')(); +var gutil = require('gulp-util'); + +var onError = function (err) { + gutil.beep(); + gutil.log( gutil.colors.red(err)); +}; gulp.task('styles', function () { return gulp.src('app/styles/main.scss') - .pipe($.rubySass({ - style: 'expanded', - precision: 10 + //.pipe($.plumber(onError)) + .pipe($.sass({ + includePaths: ['app/bower_components/foundation/scss'], + errLogToConsole: true })) .pipe($.autoprefixer('last 1 version')) - .pipe(gulp.dest('.tmp/styles')) + .pipe($.plumber.stop()) + .pipe(gulp.dest('dist/styles')) + .pipe($.size()); +}); + +gulp.task('diststyles', function () { + return gulp.src('app/styles/main.scss') + .pipe($.sass({ + includePaths: ['bower_components/foundation/scss'] + })) + .pipe($.autoprefixer('last 1 version')) + .pipe($.csso()) + .pipe(gulp.dest('dist/styles')) .pipe($.size()); }); @@ -24,21 +44,12 @@ gulp.task('scripts', function () { .pipe($.size()); }); -gulp.task('html', ['styles', 'scripts'], function () { - var jsFilter = $.filter('**/*.js'); - var cssFilter = $.filter('**/*.css'); - - return gulp.src('app/*.php') - .pipe($.useref.assets({searchPath: '{.tmp,app}'})) - .pipe(jsFilter) +gulp.task('distscripts', function () { + return gulp.src('app/scripts/**/*.js') + .pipe($.jshint()) + .pipe($.jshint.reporter(require('jshint-stylish'))) .pipe($.uglify()) - .pipe(jsFilter.restore()) - .pipe(cssFilter) - .pipe($.csso()) - .pipe(cssFilter.restore()) - .pipe($.useref.restore()) - .pipe($.useref()) - .pipe(gulp.dest('dist')) + .pipe(gulp.dest('dist/scripts')) .pipe($.size()); }); @@ -70,7 +81,7 @@ gulp.task('clean', function () { return gulp.src(['.tmp', 'dist'], { read: false }).pipe($.clean()); }); -gulp.task('build', ['html', 'images', 'fonts', 'extras']); +gulp.task('build', ['distscripts', 'diststyles', 'images', 'fonts', 'extras']); gulp.task('default', ['clean'], function () { gulp.start('build'); @@ -90,7 +101,7 @@ gulp.task('wiredep', function () { })) .pipe(gulp.dest('app/styles')); - gulp.src('app/*.php') + gulp.src('*.php') .pipe(wiredep({ directory: 'app/bower_components' })) @@ -103,10 +114,10 @@ gulp.task('watch', ['serve'], function () { // watch for changes gulp.watch([ - 'app/*.php', - '.tmp/styles/**/*.css', - 'app/scripts/**/*.js', - 'app/images/**/*' + '*.php', + 'dist/styles/**/*.css', + 'dist/scripts/**/*.js', + 'dist/images/**/*' ]).on('change', function (file) { server.changed(file.path); }); diff --git a/wp-content/themes/aktiv2014/header.php b/wp-content/themes/aktiv2014/header.php index 44666cb..fcb82f4 100644 --- a/wp-content/themes/aktiv2014/header.php +++ b/wp-content/themes/aktiv2014/header.php @@ -9,10 +9,10 @@ - + - + diff --git a/wp-content/themes/aktiv2014/index.php b/wp-content/themes/aktiv2014/index.php index 82db677..91ce1bc 100644 --- a/wp-content/themes/aktiv2014/index.php +++ b/wp-content/themes/aktiv2014/index.php @@ -1,24 +1,33 @@ -
-

+

- +
> -
-

+
+ +

+ - + + + -
+ +
+ +
+ - -
+ +
- +
+ + diff --git a/wp-content/themes/aktiv2014/package.json b/wp-content/themes/aktiv2014/package.json index dc96e15..e5cfa59 100644 --- a/wp-content/themes/aktiv2014/package.json +++ b/wp-content/themes/aktiv2014/package.json @@ -23,7 +23,10 @@ "gulp-useref": "^0.4.2", "jshint-stylish": "^0.2.0", "opn": "^0.1.1", - "wiredep": "^1.4.3" + "wiredep": "^1.4.3", + "gulp-plumber": "~0.6.3", + "gulp-sass": "~0.7.2", + "gulp-util": "~2.2.19" }, "engines": { "node": ">=0.10.0" diff --git a/wp-content/themes/aktiv2014/page-front-page.php b/wp-content/themes/aktiv2014/page-front-page.php index 38926d9..9499fa6 100644 --- a/wp-content/themes/aktiv2014/page-front-page.php +++ b/wp-content/themes/aktiv2014/page-front-page.php @@ -9,7 +9,10 @@
- +
+ +
+