├── .gitignore ├── README.md ├── app.css ├── app.min.css ├── config.codekit ├── dummy-content.xml ├── functions.php ├── gulpfile.js ├── js ├── app.js ├── min │ ├── app-min.js │ ├── app.js │ ├── app.min.js │ ├── scripts.js │ └── scripts.min.js └── scripts.js ├── lib ├── cpt │ └── theme-cpt.php ├── genesis.php ├── mdl │ ├── archive.php │ ├── footer.php │ ├── header.php │ ├── markup.php │ ├── menu-walker.php │ ├── menu.php │ ├── pagination.php │ ├── post.php │ └── search.php ├── structure │ ├── archive.php │ ├── breadcrumbs.php │ ├── footer.php │ ├── gallery.php │ ├── head.php │ ├── header.php │ ├── menu.php │ ├── post.php │ ├── scripts.php │ ├── search.php │ └── sidebar.php ├── theme-functions.php └── theme-helpers.php ├── package-lock.json ├── package.json ├── screenshot.png ├── style.css ├── styles ├── _accessibility.scss ├── _basic.scss ├── _color-definitions.scss ├── _featherlight.scss ├── _functions.scss ├── _mixins.scss ├── _variables.scss ├── _wordpress.scss └── app.scss └── templates └── partials └── inc-social_sharing.php /.gitignore: -------------------------------------------------------------------------------- 1 | # Packages # 2 | ############ 3 | *.7z 4 | *.dmg 5 | *.gz 6 | *.bz2 7 | *.iso 8 | *.jar 9 | *.rar 10 | *.tar 11 | *.zip 12 | *.tgz 13 | *.map 14 | 15 | # Logs and databases # 16 | ###################### 17 | *.log 18 | *.sql 19 | 20 | # OS generated files # 21 | ###################### 22 | **.DS_Store* 23 | ehthumbs.db 24 | Icon? 25 | Thumbs.db 26 | ._* 27 | 28 | # SASS # 29 | ########## 30 | **/.sass-cache 31 | **/.sass-cache/* 32 | **/.map 33 | 34 | # NPM # 35 | ########## 36 | node_modules 37 | 38 | # Compiled Files and Build Dirs # 39 | ########## 40 | /README.html 41 | /build/ 42 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Genesis Material Design Lite Child Theme 2 | === 3 | 4 | This child theme is made for Genesis and uses components and style elements/directives from Material design lite. 5 | 6 | This branch gives you a pre-compiled theme ready to use, and also all the tools you need to configure your own js and css files(gulp and codekit). 7 | 8 | 9 | In any case, you can use it as is by cloning/downloading the .zip file. 10 | 11 | * All bases functionalities from Genesis can be used. Just note that Primary menu will be the one in the top bar and make sure to make another one for the "drawer functionality". 12 | * This child theme comes with a lot of ready to use common Genesis functions, check the `lib` folder. 13 | * This is totally open source, so feel free to use/change as you wish. 14 | * Licensed under GPLv2. 15 | 16 | You can see a working demo [here](http://demo-mdl.lostwebdesigns.com) 17 | 18 | How to use 19 | --------------- 20 | 21 | Nothing is more easy, download .zip or clone this repository, add it to your themes folder or upload it(only a .zip file) from your website adminstration panel and you are ready to go. 22 | 23 | If you want to use it with gulp, this theme now uses the really well done [WPGULP](https://github.com/ahmadawais/WPGulp) so this gulp file may always stay updated. 24 | Just set up your project variables in the gulpfile, run `npm install` to install all dependencies, then just run `gulp`. 25 | A `gulp build` task is also prepacked giving you your optimized theme in a ready to upload .zip file 26 | 27 | Prefer codekit, easy, just run `npm install` and you are good to go. 28 | 29 | Included is a dummy-content.xml file if you ever need some content, it's actually taken from Genesis base child Theme. 30 | 31 | 32 | You are now ready to go! 33 | 34 | Enjoy! 35 | -------------------------------------------------------------------------------- /functions.php: -------------------------------------------------------------------------------- 1 | >. Edit the variables as per your project requirements. 28 | */ 29 | 30 | // START Editing Project Variables. 31 | // Project related. 32 | var project = 'genesis-material-design-lite-child-theme'; // Project Name. 33 | var projectURL = 'wp-plugins.dev'; // Local project URL of your already running WordPress site. Could be something like local.dev or localhost:8888. 34 | var productURL = './'; // Theme/Plugin URL. Leave it like it is, since our gulpfile.js lives in the root folder. 35 | 36 | // Translation related. 37 | var text_domain = 'mdl-child'; // Your textdomain here. 38 | var translationFile = 'mdl-child.pot'; // Name of the transalation file. 39 | var translationDestination = './languages'; // Where to save the translation files. 40 | var packageName = 'material-design-lite-child'; // Package name. 41 | var bugReport = ''; // Where can users report bugs. 42 | var lastTranslator = ''; // Last translator Email ID. 43 | var team = 'WPTie '; // Team's Email ID. 44 | 45 | // Style related. 46 | var styleSRC = './styles/app.scss'; // Path to main .scss file. 47 | var styleDestination = './'; // Path to place the compiled CSS file. 48 | // Default set to root folder. 49 | 50 | // JS Vendor related. All the mdl scripts, comment/uncomment as necessary 51 | var jsVendorSRC = [ 52 | // Component handler 53 | './node_modules/material-design-lite/src/mdlComponentHandler.js', 54 | // Polyfills/dependencies 55 | './node_modules/material-design-lite/src/third_party/**/*.js', 56 | // Base components 57 | './node_modules/material-design-lite/src/button/button.js', 58 | // './node_modules/material-design-lite/src/checkbox/checkbox.js', 59 | // './node_modules/material-design-lite/src/icon-toggle/icon-toggle.js', 60 | // './node_modules/material-design-lite/src/menu/menu.js', 61 | // './node_modules/material-design-lite/src/progress/progress.js', 62 | // './node_modules/material-design-lite/src/radio/radio.js', 63 | // './node_modules/material-design-lite/src/slider/slider.js', 64 | // './node_modules/material-design-lite/src/spinner/spinner.js', 65 | // './node_modules/material-design-lite/src/switch/switch.js', 66 | './node_modules/material-design-lite/src/tabs/tabs.js', 67 | './node_modules/material-design-lite/src/textfield/textfield.js', 68 | // './node_modules/material-design-lite/src/tooltip/tooltip.js', 69 | // Complex components (which reuse base components) 70 | './node_modules/material-design-lite/src/layout/layout.js', 71 | // './node_modules/material-design-lite/src/data-table/data-table.js', 72 | // And finally, the ripples 73 | // './node_modules/material-design-lite/src/ripple/ripple.js', 74 | './js/app.js' 75 | ]; 76 | 77 | var jsVendorDestination = './js/min/'; // Path to place the compiled JS vendors file. 78 | var jsVendorFile = 'app'; // Compiled JS vendors file name. 79 | // Default set to vendors i.e. vendors.js. 80 | 81 | // JS Custom related. 82 | var jsCustomSRC = './js/scripts.js'; // Path to JS custom scripts folder. 83 | var jsCustomDestination = './js/min/'; // Path to place the compiled JS custom scripts file. 84 | var jsCustomFile = 'scripts'; // Compiled JS custom file name. 85 | // Default set to custom i.e. custom.js. 86 | 87 | // Images related. 88 | var imagesSRC = './img/'; // Source folder of images which should be optimized. 89 | var imagesDestination = './img/'; // Destination folder of optimized images. Must be different from the imagesSRC folder. 90 | 91 | // Watch files paths. 92 | var styleWatchFiles = './styles/**/*.scss'; // Path to all *.scss files inside css folder and inside them. 93 | var vendorJSWatchFiles = './js/app.js'; // Path to all vendor JS files. 94 | var customJSWatchFiles = './js/scripts.js'; // Path to all custom JS files. 95 | var projectPHPWatchFiles = './**/*.php'; // Path to all PHP files. 96 | 97 | 98 | // Browsers you care about for autoprefixing. 99 | // Browserlist https ://github.com/ai/browserslist 100 | const AUTOPREFIXER_BROWSERS = [ 101 | 'last 2 version', 102 | '> 1%', 103 | 'ie >= 9', 104 | 'ie_mob >= 10', 105 | 'ff >= 30', 106 | 'chrome >= 34', 107 | 'safari >= 7', 108 | 'opera >= 23', 109 | 'ios >= 7', 110 | 'android >= 4', 111 | 'bb >= 10' 112 | ]; 113 | 114 | // STOP Editing Project Variables. 115 | 116 | /** 117 | * Load Plugins. 118 | * 119 | * Load gulp plugins and passign them semantic names. 120 | */ 121 | var gulp = require('gulp'); // Gulp of-course 122 | 123 | // CSS related plugins. 124 | var sass = require('gulp-sass'); // Gulp pluign for Sass compilation. 125 | var minifycss = require('gulp-uglifycss'); // Minifies CSS files. 126 | var autoprefixer = require('gulp-autoprefixer'); // Autoprefixing magic. 127 | var mmq = require('gulp-merge-media-queries'); // Combine matching media queries into one media query definition. 128 | 129 | // JS related plugins. 130 | var concat = require('gulp-concat'); // Concatenates JS files 131 | var uglify = require('gulp-uglify'); // Minifies JS files 132 | 133 | // Image realted plugins. 134 | var imagemin = require('gulp-imagemin'); // Minify PNG, JPEG, GIF and SVG images with imagemin. 135 | 136 | // Utility related plugins. 137 | var rename = require('gulp-rename'); // Renames files E.g. style.css -> style.min.css 138 | var lineec = require('gulp-line-ending-corrector'); // Consistent Line Endings for non UNIX systems. Gulp Plugin for Line Ending Corrector (A utility that makes sure your files have consistent line endings) 139 | var filter = require('gulp-filter'); // Enables you to work on a subset of the original files by filtering them usign globbing. 140 | var sourcemaps = require('gulp-sourcemaps'); // Maps code in a compressed file (E.g. style.css) back to it’s original position in a source file (E.g. structure.scss, which was later combined with other css files to generate style.css) 141 | var notify = require('gulp-notify'); // Sends message notification to you 142 | var browserSync = require('browser-sync').create(); // Reloads browser and injects CSS. Time-saving synchronised browser testing. 143 | var reload = browserSync.reload; // For manual browser reload. 144 | var wpPot = require('gulp-wp-pot'); // For generating the .pot file. 145 | var sort = require('gulp-sort'); // Recommended to prevent unnecessary changes in pot-file. 146 | 147 | /** 148 | * Task: `browser-sync`. 149 | * 150 | * Live Reloads, CSS injections, Localhost tunneling. 151 | * 152 | * This task does the following: 153 | * 1. Sets the project URL 154 | * 2. Sets inject CSS 155 | * 3. You may define a custom port 156 | * 4. You may want to stop the browser from openning automatically 157 | */ 158 | gulp.task( 'browser-sync', function() { 159 | browserSync.init( { 160 | 161 | // For more options 162 | // @link http://www.browsersync.io/docs/options/ 163 | 164 | // Project URL. 165 | proxy: projectURL, 166 | 167 | // `true` Automatically open the browser with BrowserSync live server. 168 | // `false` Stop the browser from automatically opening. 169 | open: true, 170 | 171 | // Inject CSS changes. 172 | // Commnet it to reload browser for every CSS change. 173 | injectChanges: true, 174 | 175 | // Use a specific port (instead of the one auto-detected by Browsersync). 176 | // port: 7000, 177 | 178 | } ); 179 | }); 180 | 181 | 182 | /** 183 | * Task: `styles`. 184 | * 185 | * Compiles Sass, Autoprefixes it and Minifies CSS. 186 | * 187 | * This task does the following: 188 | * 1. Gets the source scss file 189 | * 2. Compiles Sass to CSS 190 | * 3. Writes Sourcemaps for it 191 | * 4. Autoprefixes it and generates style.css 192 | * 5. Renames the CSS file with suffix .min.css 193 | * 6. Minifies the CSS file and generates style.min.css 194 | * 7. Injects CSS or reloads the browser via browserSync 195 | */ 196 | gulp.task('styles', function () { 197 | gulp.src( styleSRC ) 198 | .pipe( sourcemaps.init() ) 199 | .pipe( sass( { 200 | errLogToConsole: true, 201 | outputStyle: 'compact', 202 | // outputStyle: 'compressed', 203 | // outputStyle: 'nested', 204 | // outputStyle: 'expanded', 205 | precision: 10 206 | } ) ) 207 | .on('error', console.error.bind(console)) 208 | .pipe( sourcemaps.write( { includeContent: false } ) ) 209 | .pipe( sourcemaps.init( { loadMaps: true } ) ) 210 | .pipe( autoprefixer( AUTOPREFIXER_BROWSERS ) ) 211 | 212 | .pipe( sourcemaps.write ( styleDestination ) ) 213 | .pipe( lineec() ) // Consistent Line Endings for non UNIX systems. 214 | .pipe( gulp.dest( styleDestination ) ) 215 | 216 | .pipe( filter( '**/*.css' ) ) // Filtering stream to only css files 217 | .pipe( mmq( { log: true } ) ) // Merge Media Queries only for .min.css version. 218 | 219 | .pipe( browserSync.stream() ) // Reloads style.css if that is enqueued. 220 | 221 | .pipe( rename( { suffix: '.min' } ) ) 222 | .pipe( minifycss( { 223 | maxLineLen: 10 224 | })) 225 | .pipe( lineec() ) // Consistent Line Endings for non UNIX systems. 226 | .pipe( gulp.dest( styleDestination ) ) 227 | 228 | .pipe( filter( '**/*.css' ) ) // Filtering stream to only css files 229 | .pipe( browserSync.stream() )// Reloads style.min.css if that is enqueued. 230 | .pipe( notify( { message: 'TASK: "styles" Completed! 💯', onLast: true } ) ) 231 | }); 232 | 233 | 234 | /** 235 | * Task: `vendorJS`. 236 | * 237 | * Concatenate and uglify vendor JS scripts. 238 | * 239 | * This task does the following: 240 | * 1. Gets the source folder for JS vendor files 241 | * 2. Concatenates all the files and generates vendors.js 242 | * 3. Renames the JS file with suffix .min.js 243 | * 4. Uglifes/Minifies the JS file and generates vendors.min.js 244 | */ 245 | gulp.task( 'vendorsJs', function() { 246 | gulp.src( jsVendorSRC ) 247 | .pipe( concat( jsVendorFile + '.js' ) ) 248 | .pipe( lineec() ) // Consistent Line Endings for non UNIX systems. 249 | .pipe( gulp.dest( jsVendorDestination ) ) 250 | .pipe( rename( { 251 | basename: jsVendorFile, 252 | suffix: '.min' 253 | })) 254 | .pipe( uglify() ) 255 | .pipe( lineec() ) // Consistent Line Endings for non UNIX systems. 256 | .pipe( gulp.dest( jsVendorDestination ) ) 257 | .pipe( notify( { message: 'TASK: "vendorsJs" Completed! 💯', onLast: true } ) ); 258 | }); 259 | 260 | 261 | /** 262 | * Task: `customJS`. 263 | * 264 | * Concatenate and uglify custom JS scripts. 265 | * 266 | * This task does the following: 267 | * 1. Gets the source folder for JS custom files 268 | * 2. Concatenates all the files and generates custom.js 269 | * 3. Renames the JS file with suffix .min.js 270 | * 4. Uglifes/Minifies the JS file and generates custom.min.js 271 | */ 272 | gulp.task( 'customJS', function() { 273 | gulp.src( jsCustomSRC ) 274 | .pipe( concat( jsCustomFile + '.js' ) ) 275 | .pipe( lineec() ) // Consistent Line Endings for non UNIX systems. 276 | .pipe( gulp.dest( jsCustomDestination ) ) 277 | .pipe( rename( { 278 | basename: jsCustomFile, 279 | suffix: '.min' 280 | })) 281 | .pipe( uglify() ) 282 | .pipe( lineec() ) // Consistent Line Endings for non UNIX systems. 283 | .pipe( gulp.dest( jsCustomDestination ) ) 284 | .pipe( notify( { message: 'TASK: "customJs" Completed! 💯', onLast: true } ) ); 285 | }); 286 | 287 | 288 | /** 289 | * Task: `images`. 290 | * 291 | * Minifies PNG, JPEG, GIF and SVG images. 292 | * 293 | * This task does the following: 294 | * 1. Gets the source of images raw folder 295 | * 2. Minifies PNG, JPEG, GIF and SVG images 296 | * 3. Generates and saves the optimized images 297 | * 298 | * This task will run only once, if you want to run it 299 | * again, do it with the command `gulp images`. 300 | */ 301 | gulp.task( 'images', function() { 302 | gulp.src( imagesSRC ) 303 | .pipe( imagemin( { 304 | progressive: true, 305 | optimizationLevel: 3, // 0-7 low-high 306 | interlaced: true, 307 | svgoPlugins: [{removeViewBox: false}] 308 | } ) ) 309 | .pipe(gulp.dest( imagesDestination )) 310 | .pipe( notify( { message: 'TASK: "images" Completed! 💯', onLast: true } ) ); 311 | }); 312 | 313 | 314 | /** 315 | * WP POT Translation File Generator. 316 | * 317 | * * This task does the following: 318 | * 1. Gets the source of all the PHP files 319 | * 2. Sort files in stream by path or any custom sort comparator 320 | * 3. Applies wpPot with the variable set at the top of this file 321 | * 4. Generate a .pot file of i18n that can be used for l10n to build .mo file 322 | */ 323 | gulp.task( 'translate', function () { 324 | return gulp.src( projectPHPWatchFiles ) 325 | .pipe(sort()) 326 | .pipe(wpPot( { 327 | domain : text_domain, 328 | destFile : translationFile, 329 | package : packageName, 330 | bugReport : bugReport, 331 | lastTranslator: lastTranslator, 332 | team : team 333 | } )) 334 | .pipe(gulp.dest(translationDestination)) 335 | .pipe( notify( { message: 'TASK: "translate" Completed! 💯', onLast: true } ) ) 336 | 337 | }); 338 | 339 | 340 | /** 341 | * Watch Tasks. 342 | * 343 | * Watches for file changes and runs specific tasks. 344 | */ 345 | gulp.task( 'default', ['styles', 'vendorsJs', 'customJS', 'images', 'browser-sync'], function () { 346 | gulp.watch( projectPHPWatchFiles, reload ); // Reload on PHP file changes. 347 | gulp.watch( styleWatchFiles, [ 'styles' ] ); // Reload on SCSS file changes. 348 | gulp.watch( vendorJSWatchFiles, [ 'vendorsJs', reload ] ); // Reload on vendorsJs file changes. 349 | gulp.watch( customJSWatchFiles, [ 'customJS', reload ] ); // Reload on customJS file changes. 350 | }); 351 | -------------------------------------------------------------------------------- /js/app.js: -------------------------------------------------------------------------------- 1 | // @codekit-prepend "../node_modules/material-design-lite/src/mdlComponentHandler.js"; 2 | // @codekit-prepend "../node_modules/material-design-lite/src/third_party/**/*.js"; 3 | // @codekit-prepend "../node_modules/material-design-lite/src/button/button.js"; 4 | // @codekit-prepend "../node_modules/material-design-lite/src/checkbox/checkbox.js"; 5 | // @codekit-prepend "../node_modules/material-design-lite/src/icon-toggle/icon-toggle.js"; 6 | // @codekit-prepend "../node_modules/material-design-lite/src/menu/menu.js"; 7 | // @codekit-prepend "../node_modules/material-design-lite/src/progress/progress.js"; 8 | // @codekit-prepend "../node_modules/material-design-lite/src/radio/radio.js"; 9 | // @codekit-prepend "../node_modules/material-design-lite/src/slider/slider.js"; 10 | // @codekit-prepend "../node_modules/material-design-lite/src/spinner/spinner.js"; 11 | // @codekit-prepend "../node_modules/material-design-lite/src/switch/switch.js"; 12 | // @codekit-prepend "../node_modules/material-design-lite/src/tabs/tabs.js"; 13 | // @codekit-prepend "../node_modules/material-design-lite/src/textfield/textfield.js"; 14 | // @codekit-prepend "../node_modules/material-design-lite/src/tooltip/tooltip.js"; 15 | // @codekit-prepend "../node_modules/material-design-lite/src/layout/layout.js"; 16 | // @codekit-prepend "../node_modules/material-design-lite/src/data-table/data-table.js"; 17 | // @codekit-prepend "../node_modules/material-design-lite/src/ripple/ripple.js"; 18 | // @codekit-prepend "../node_modules/featherlight/src/featherlight.js"; 19 | // @codekit-prepend "../node_modules/featherlight/src/featherlight.gallery.js"; 20 | 21 | (function($){ 22 | 23 | $(function(){ 24 | $('.gallery-item').find('a').featherlightGallery({ 25 | previousIcon: 'keyboard_arrow_left', 26 | nextIcon: 'keyboard_arrow_right', 27 | closeIcon: '', 28 | }); 29 | }); 30 | 31 | })(jQuery); 32 | -------------------------------------------------------------------------------- /js/min/app.min.js: -------------------------------------------------------------------------------- 1 | var componentHandler={upgradeDom:function(s,e){},upgradeElement:function(s,e){},upgradeElements:function(s){},upgradeAllRegistered:function(){},registerUpgradedCallback:function(s,e){},register:function(s){},downgradeElements:function(s){}};componentHandler=function(){"use strict";function s(s,e){for(var t=0;t0&&r(e.children))}function l(e){var t="undefined"==typeof e.widget&&"undefined"==typeof e.widget,i=!0;t||(i=e.widget||e.widget);var a={classConstructor:e.constructor||e.constructor,className:e.classAsString||e.classAsString,cssClass:e.cssClass||e.cssClass,widget:i,callbacks:[]};if(h.forEach(function(s){if(s.cssClass===a.cssClass)throw new Error("The provided cssClass has already been registered: "+s.cssClass);if(s.className===a.className)throw new Error("The provided className has already been registered")}),e.constructor.prototype.hasOwnProperty(u))throw new Error("MDL component classes must not have "+u+" defined as a property.");var n=s(e.classAsString,a);n||h.push(a)}function o(e,t){var i=s(e);i&&i.callbacks.push(t)}function d(){for(var s=0;s=this.maxRows&&s.preventDefault()},s.prototype.onFocus_=function(s){this.element_.classList.add(this.CssClasses_.IS_FOCUSED)},s.prototype.onBlur_=function(s){this.element_.classList.remove(this.CssClasses_.IS_FOCUSED)},s.prototype.onReset_=function(s){this.updateClasses_()},s.prototype.updateClasses_=function(){this.checkDisabled(),this.checkValidity(),this.checkDirty(),this.checkFocus()},s.prototype.checkDisabled=function(){this.input_.disabled?this.element_.classList.add(this.CssClasses_.IS_DISABLED):this.element_.classList.remove(this.CssClasses_.IS_DISABLED)},s.prototype.checkDisabled=s.prototype.checkDisabled,s.prototype.checkFocus=function(){Boolean(this.element_.querySelector(":focus"))?this.element_.classList.add(this.CssClasses_.IS_FOCUSED):this.element_.classList.remove(this.CssClasses_.IS_FOCUSED)},s.prototype.checkFocus=s.prototype.checkFocus,s.prototype.checkValidity=function(){this.input_.validity&&(this.input_.validity.valid?this.element_.classList.remove(this.CssClasses_.IS_INVALID):this.element_.classList.add(this.CssClasses_.IS_INVALID))},s.prototype.checkValidity=s.prototype.checkValidity,s.prototype.checkDirty=function(){this.input_.value&&this.input_.value.length>0?this.element_.classList.add(this.CssClasses_.IS_DIRTY):this.element_.classList.remove(this.CssClasses_.IS_DIRTY)},s.prototype.checkDirty=s.prototype.checkDirty,s.prototype.disable=function(){this.input_.disabled=!0,this.updateClasses_()},s.prototype.disable=s.prototype.disable,s.prototype.enable=function(){this.input_.disabled=!1,this.updateClasses_()},s.prototype.enable=s.prototype.enable,s.prototype.change=function(s){this.input_.value=s||"",this.updateClasses_()},s.prototype.change=s.prototype.change,s.prototype.init=function(){if(this.element_&&(this.label_=this.element_.querySelector("."+this.CssClasses_.LABEL),this.input_=this.element_.querySelector("."+this.CssClasses_.INPUT),this.input_)){this.input_.hasAttribute(this.Constant_.MAX_ROWS_ATTRIBUTE)&&(this.maxRows=parseInt(this.input_.getAttribute(this.Constant_.MAX_ROWS_ATTRIBUTE),10),isNaN(this.maxRows)&&(this.maxRows=this.Constant_.NO_MAX_ROWS)),this.input_.hasAttribute("placeholder")&&this.element_.classList.add(this.CssClasses_.HAS_PLACEHOLDER),this.boundUpdateClassesHandler=this.updateClasses_.bind(this),this.boundFocusHandler=this.onFocus_.bind(this),this.boundBlurHandler=this.onBlur_.bind(this),this.boundResetHandler=this.onReset_.bind(this),this.input_.addEventListener("input",this.boundUpdateClassesHandler),this.input_.addEventListener("focus",this.boundFocusHandler),this.input_.addEventListener("blur",this.boundBlurHandler),this.input_.addEventListener("reset",this.boundResetHandler),this.maxRows!==this.Constant_.NO_MAX_ROWS&&(this.boundKeyDownHandler=this.onKeyDown_.bind(this),this.input_.addEventListener("keydown",this.boundKeyDownHandler));var s=this.element_.classList.contains(this.CssClasses_.IS_INVALID);this.updateClasses_(),this.element_.classList.add(this.CssClasses_.IS_UPGRADED),s&&this.element_.classList.add(this.CssClasses_.IS_INVALID),this.input_.hasAttribute("autofocus")&&(this.element_.focus(),this.checkFocus())}},componentHandler.register({constructor:s,classAsString:"MaterialTextfield",cssClass:"mdl-js-textfield",widget:!0})}(),function(){"use strict";function s(s,e,t,i){function a(){var a=s.href.split("#")[1],n=i.content_.querySelector("#"+a);i.resetTabState_(e),i.resetPanelState_(t),s.classList.add(i.CssClasses_.IS_ACTIVE),n.classList.add(i.CssClasses_.IS_ACTIVE)}if(i.tabBar_.classList.contains(i.CssClasses_.JS_RIPPLE_EFFECT)){var n=document.createElement("span");n.classList.add(i.CssClasses_.RIPPLE_CONTAINER),n.classList.add(i.CssClasses_.JS_RIPPLE_EFFECT);var r=document.createElement("span");r.classList.add(i.CssClasses_.RIPPLE),n.appendChild(r),s.appendChild(n)}i.tabBar_.classList.contains(i.CssClasses_.TAB_MANUAL_SWITCH)||s.addEventListener("click",function(e){"#"===s.getAttribute("href").charAt(0)&&(e.preventDefault(),a())}),s.show=a}var e=function(s){this.element_=s,this.init()};window.MaterialLayout=e,e.prototype.Constant_={MAX_WIDTH:"(max-width: 1024px)",TAB_SCROLL_PIXELS:100,RESIZE_TIMEOUT:100,MENU_ICON:"",CHEVRON_LEFT:"chevron_left",CHEVRON_RIGHT:"chevron_right"},e.prototype.Keycodes_={ENTER:13,ESCAPE:27,SPACE:32},e.prototype.Mode_={STANDARD:0,SEAMED:1,WATERFALL:2,SCROLL:3},e.prototype.CssClasses_={CONTAINER:"mdl-layout__container",HEADER:"mdl-layout__header",DRAWER:"mdl-layout__drawer",CONTENT:"mdl-layout__content",DRAWER_BTN:"mdl-layout__drawer-button",ICON:"material-icons",JS_RIPPLE_EFFECT:"mdl-js-ripple-effect",RIPPLE_CONTAINER:"mdl-layout__tab-ripple-container",RIPPLE:"mdl-ripple",RIPPLE_IGNORE_EVENTS:"mdl-js-ripple-effect--ignore-events",HEADER_SEAMED:"mdl-layout__header--seamed",HEADER_WATERFALL:"mdl-layout__header--waterfall",HEADER_SCROLL:"mdl-layout__header--scroll",FIXED_HEADER:"mdl-layout--fixed-header",OBFUSCATOR:"mdl-layout__obfuscator",TAB_BAR:"mdl-layout__tab-bar",TAB_CONTAINER:"mdl-layout__tab-bar-container",TAB:"mdl-layout__tab",TAB_BAR_BUTTON:"mdl-layout__tab-bar-button",TAB_BAR_LEFT_BUTTON:"mdl-layout__tab-bar-left-button",TAB_BAR_RIGHT_BUTTON:"mdl-layout__tab-bar-right-button",TAB_MANUAL_SWITCH:"mdl-layout__tab-manual-switch",PANEL:"mdl-layout__tab-panel",HAS_DRAWER:"has-drawer",HAS_TABS:"has-tabs",HAS_SCROLLING_HEADER:"has-scrolling-header",CASTING_SHADOW:"is-casting-shadow",IS_COMPACT:"is-compact",IS_SMALL_SCREEN:"is-small-screen",IS_DRAWER_OPEN:"is-visible",IS_ACTIVE:"is-active",IS_UPGRADED:"is-upgraded",IS_ANIMATING:"is-animating",ON_LARGE_SCREEN:"mdl-layout--large-screen-only",ON_SMALL_SCREEN:"mdl-layout--small-screen-only"},e.prototype.contentScrollHandler_=function(){if(!this.header_.classList.contains(this.CssClasses_.IS_ANIMATING)){var s=!this.element_.classList.contains(this.CssClasses_.IS_SMALL_SCREEN)||this.element_.classList.contains(this.CssClasses_.FIXED_HEADER);this.content_.scrollTop>0&&!this.header_.classList.contains(this.CssClasses_.IS_COMPACT)?(this.header_.classList.add(this.CssClasses_.CASTING_SHADOW),this.header_.classList.add(this.CssClasses_.IS_COMPACT),s&&this.header_.classList.add(this.CssClasses_.IS_ANIMATING)):this.content_.scrollTop<=0&&this.header_.classList.contains(this.CssClasses_.IS_COMPACT)&&(this.header_.classList.remove(this.CssClasses_.CASTING_SHADOW),this.header_.classList.remove(this.CssClasses_.IS_COMPACT),s&&this.header_.classList.add(this.CssClasses_.IS_ANIMATING))}},e.prototype.keyboardEventHandler_=function(s){s.keyCode===this.Keycodes_.ESCAPE&&this.drawer_.classList.contains(this.CssClasses_.IS_DRAWER_OPEN)&&this.toggleDrawer()},e.prototype.screenSizeHandler_=function(){this.screenSizeMediaQuery_.matches?this.element_.classList.add(this.CssClasses_.IS_SMALL_SCREEN):(this.element_.classList.remove(this.CssClasses_.IS_SMALL_SCREEN),this.drawer_&&(this.drawer_.classList.remove(this.CssClasses_.IS_DRAWER_OPEN),this.obfuscator_.classList.remove(this.CssClasses_.IS_DRAWER_OPEN)))},e.prototype.drawerToggleHandler_=function(s){if(s&&"keydown"===s.type){if(s.keyCode!==this.Keycodes_.SPACE&&s.keyCode!==this.Keycodes_.ENTER)return;s.preventDefault()}this.toggleDrawer()},e.prototype.headerTransitionEndHandler_=function(){this.header_.classList.remove(this.CssClasses_.IS_ANIMATING)},e.prototype.headerClickHandler_=function(){this.header_.classList.contains(this.CssClasses_.IS_COMPACT)&&(this.header_.classList.remove(this.CssClasses_.IS_COMPACT),this.header_.classList.add(this.CssClasses_.IS_ANIMATING))},e.prototype.resetTabState_=function(s){for(var e=0;e0?h.classList.add(this.CssClasses_.IS_ACTIVE):h.classList.remove(this.CssClasses_.IS_ACTIVE),this.tabBar_.scrollLeftkeyboard_arrow_left',nextIcon:'keyboard_arrow_right',closeIcon:''})})}(jQuery); -------------------------------------------------------------------------------- /js/min/scripts.js: -------------------------------------------------------------------------------- 1 | ;(function(){ 2 | /** 3 | * 4 | * You can add your custom javascript below 5 | * 6 | **/ 7 | 8 | 9 | })(jQuery); 10 | -------------------------------------------------------------------------------- /js/min/scripts.min.js: -------------------------------------------------------------------------------- 1 | !function(){}(jQuery); -------------------------------------------------------------------------------- /js/scripts.js: -------------------------------------------------------------------------------- 1 | ;(function(){ 2 | /** 3 | * 4 | * You can add your custom javascript below 5 | * 6 | **/ 7 | 8 | 9 | })(jQuery); 10 | -------------------------------------------------------------------------------- /lib/cpt/theme-cpt.php: -------------------------------------------------------------------------------- 1 | _x( 'Post Types', 'Post Type General Name', 'genesis-material-design-lite-child-theme' ), 9 | 'singular_name' => _x( 'Post Type', 'Post Type Singular Name', 'genesis-material-design-lite-child-theme' ), 10 | 'menu_name' => __( 'Post Type', 'genesis-material-design-lite-child-theme' ), 11 | 'name_admin_bar' => __( 'Post Type', 'genesis-material-design-lite-child-theme' ), 12 | 'parent_item_colon' => __( 'Parent Item:', 'genesis-material-design-lite-child-theme' ), 13 | 'all_items' => __( 'All Items', 'genesis-material-design-lite-child-theme' ), 14 | 'add_new_item' => __( 'Add New Item', 'genesis-material-design-lite-child-theme' ), 15 | 'add_new' => __( 'Add New', 'genesis-material-design-lite-child-theme' ), 16 | 'new_item' => __( 'New Item', 'genesis-material-design-lite-child-theme' ), 17 | 'edit_item' => __( 'Edit Item', 'genesis-material-design-lite-child-theme' ), 18 | 'update_item' => __( 'Update Item', 'genesis-material-design-lite-child-theme' ), 19 | 'view_item' => __( 'View Item', 'genesis-material-design-lite-child-theme' ), 20 | 'search_items' => __( 'Search Item', 'genesis-material-design-lite-child-theme' ), 21 | 'not_found' => __( 'Not found', 'genesis-material-design-lite-child-theme' ), 22 | 'not_found_in_trash' => __( 'Not found in Trash', 'genesis-material-design-lite-child-theme' ), 23 | ); 24 | $args = array( 25 | 'label' => __( 'Post Type', 'genesis-material-design-lite-child-theme' ), 26 | 'description' => __( 'Post Type Description', 'genesis-material-design-lite-child-theme' ), 27 | 'labels' => $labels, 28 | 'supports' => array( ), 29 | 'taxonomies' => array( 'category', 'post_tag' ), 30 | 'hierarchical' => false, 31 | 'public' => true, 32 | 'show_ui' => true, 33 | 'show_in_menu' => true, 34 | 'menu_position' => 5, 35 | 'show_in_admin_bar' => true, 36 | 'show_in_nav_menus' => true, 37 | 'can_export' => true, 38 | 'has_archive' => true, 39 | 'exclude_from_search' => false, 40 | 'publicly_queryable' => true, 41 | 'capability_type' => 'page', 42 | ); 43 | register_post_type( 'post_type', $args ); 44 | 45 | } 46 | add_action( 'init', 'custom_post_type', 0 ); 47 | -------------------------------------------------------------------------------- /lib/genesis.php: -------------------------------------------------------------------------------- 1 | tags for mobile responsiveness. 16 | * 17 | * See: http://www.briangardner.com/code/add-viewport-meta-tag/ 18 | * 19 | * @since 2.0.0 20 | */ 21 | add_theme_support( 'genesis-responsive-viewport' ); 22 | 23 | add_theme_support( 'genesis-structural-wraps', array('footer-widgets' ) ); 24 | 25 | /** 26 | * 27 | * Add new accessibility feats 28 | * 29 | **/ 30 | add_theme_support( 'genesis-accessibility', 31 | array( 'headings', 'drop-down-menu', 'search-form', 'skip-links', 'rems' ) 32 | ); 33 | 34 | /** 35 | * Add support for custom backgrounds 36 | * 37 | * @since 2.0.2 38 | */ 39 | add_theme_support( 'custom-background' ); 40 | 41 | add_theme_support( "title-tag" ); 42 | 43 | add_editor_style(); 44 | 45 | /** 46 | * Add support for a custom header 47 | * 48 | * @since 2.0.9 49 | */ 50 | // The Header-image 51 | $defaults = array( 52 | 53 | 'default-image' => '', 54 | 'width' => 1440, 55 | 'height' => 360, 56 | 'flex-width' => true, 57 | 'flex-height' => false, 58 | 'uploads' => true, 59 | 'random-default' => false, 60 | 'header-text' => false, 61 | 'default-text-color' => '', 62 | 'wp-head' => '', 63 | 'admin-head-callback' => '', 64 | 'admin-preview-callback' => '', 65 | ); 66 | 67 | add_theme_support( 'custom-header', $defaults ); 68 | 69 | 70 | /** 71 | * Add Genesis post format support 72 | * 73 | * @since 2.0.9 74 | */ 75 | add_theme_support( 'post-formats', array( 76 | 'aside', 77 | 'chat', 78 | 'gallery', 79 | 'image', 80 | 'link', 81 | 'quote', 82 | 'status', 83 | 'video', 84 | 'audio' 85 | )); 86 | add_theme_support( 'genesis-post-format-images' ); 87 | 88 | /** 89 | * Add Genesis footer widget areas 90 | * 91 | * @since 2.0.1 92 | */ 93 | add_theme_support( 'genesis-footer-widgets', 3 ); 94 | 95 | /** 96 | * Add Genesis theme color scheme selection theme option 97 | * 98 | * @since 2.0.11 99 | */ 100 | /*add_theme_support(*/ 101 | //'genesis-style-selector', 102 | //array( 103 | //'yg-red' => 'Red', 104 | //'yg-orange' => 'Orange' 105 | //) 106 | /*);*/ 107 | 108 | /** 109 | * Declare WooCommerce support, using Genesis Connect for WooCommerce 110 | * 111 | * See: http://wordpress.org/plugins/genesis-connect-woocommerce/ 112 | * 113 | * @since 2.0.6 114 | */ 115 | add_theme_support( 'genesis-connect-woocommerce' ); 116 | 117 | 118 | /** 119 | * Unregister default Genesis sidebars 120 | * 121 | * @since 1.x 122 | */ 123 | unregister_sidebar( 'header-right' ); 124 | // unregister_sidebar( 'sidebar-alt' ); 125 | // unregister_sidebar( 'sidebar' ); 126 | 127 | /** 128 | * 129 | * Remove and move Alt sidebar inside content-sidebar 130 | * 131 | **/ 132 | remove_action( 'genesis_after_content_sidebar_wrap', 'genesis_get_sidebar_alt' ); 133 | add_action( 'genesis_after_content', 'genesis_get_sidebar_alt' ); 134 | 135 | // add_action( 'widgets_init', 'gmdl_remove_genesis_widgets', 20 ); 136 | /** 137 | * Disable some or all of the default Genesis widgets. 138 | * 139 | * @since 2.0.0 140 | */ 141 | function gmdl_remove_genesis_widgets() { 142 | 143 | unregister_widget( 'Genesis_Featured_Page' ); // Featured Page 144 | unregister_widget( 'Genesis_User_Profile_Widget' ); // User Profile 145 | unregister_widget( 'Genesis_Featured_Post' ); // Featured Posts 146 | 147 | } 148 | 149 | // add_action( 'init', 'gmdl_remove_layout_meta_boxes' ); 150 | /** 151 | * Remove the Genesis 'Layout Settings' meta box for posts and/or pages. 152 | * 153 | * @since 2.0.0 154 | */ 155 | function gmdl_remove_layout_meta_boxes() { 156 | 157 | remove_post_type_support( 'post', 'genesis-layouts' ); // Posts 158 | remove_post_type_support( 'page', 'genesis-layouts' ); // Pages 159 | 160 | } 161 | 162 | add_action( 'init', 'gmdl_remove_scripts_meta_boxes' ); 163 | /** 164 | * Remove the Genesis 'Scripts' meta box for posts and/or pages. 165 | * 166 | * @since 2.0.12 167 | */ 168 | function gmdl_remove_scripts_meta_boxes() { 169 | 170 | remove_post_type_support( 'post', 'genesis-scripts' ); // Posts 171 | remove_post_type_support( 'page', 'genesis-scripts' ); // Pages 172 | 173 | } 174 | -------------------------------------------------------------------------------- /lib/mdl/archive.php: -------------------------------------------------------------------------------- 1 | %s', $footer_widget_large_class, $counter, $widgets ); 53 | 54 | $counter++; 55 | 56 | } 57 | 58 | if ( $inside ) { 59 | 60 | $output .= genesis_markup( array( 61 | 'html5' => '
', 62 | 'xhtml' => ''; 73 | 74 | } 75 | 76 | echo apply_filters( 'genesis_footer_widget_areas', $output, $footer_widgets ); 77 | 78 | } 79 | 80 | -------------------------------------------------------------------------------- /lib/mdl/header.php: -------------------------------------------------------------------------------- 1 | '
', 18 | 'xhtml' => '
', 41 | 'xhtml' => '
', 42 | ) ); 43 | 44 | } 45 | 46 | 47 | remove_action( 'genesis_header', 'genesis_do_header'); 48 | add_action( 'genesis_header', 'gmdl_do_header' ); 49 | /** 50 | * Echo the default header, including the #title-area div, along with #title and #description, as well as the .widget-area. 51 | * 52 | * Does the `genesis_site_title`, `genesis_site_description` and `genesis_header_right` actions. 53 | * 54 | * @since 1.0.2 55 | * 56 | * @global $wp_registered_sidebars Holds all of the registered sidebars. 57 | * 58 | * @uses genesis_markup() Apply contextual markup. 59 | */ 60 | function gmdl_do_header() { 61 | 62 | global $wp_registered_sidebars; 63 | genesis_markup( array( 64 | 'html5' => '
', 65 | 'xhtml' => '
', 66 | 'context' => 'title-area', 67 | ) ); 68 | do_action( 'genesis_site_title' ); 69 | do_action( 'genesis_site_description' ); 70 | echo '
'; 71 | echo '
'; 72 | 73 | 74 | if ( ( isset( $wp_registered_sidebars['header-right'] ) && is_active_sidebar( 'header-right' ) ) || has_action( 'genesis_header_right' ) ) { 75 | genesis_markup( array( 76 | 'html5' => '
', 90 | 'xhtml' => '', 91 | ) ); 92 | } 93 | 94 | } 95 | 96 | 97 | remove_action( 'genesis_site_title', 'genesis_seo_site_title' ); 98 | add_action( 'genesis_site_title', 'gmdl_seo_site_title' ); 99 | /** 100 | * Echo the site title into the header. 101 | * 102 | * Depending on the SEO option set by the user, this will either be wrapped in an `h1` or `p` element. 103 | * 104 | * Applies the `genesis_seo_title` filter before echoing. 105 | * 106 | * @since 1.1.0 107 | * 108 | * @uses genesis_get_seo_option() Get SEO setting value. 109 | * @uses genesis_html5() Check or HTML5 support. 110 | */ 111 | function gmdl_seo_site_title() { 112 | 113 | // Set what goes inside the wrapping tags 114 | $inside = sprintf( '%s', trailingslashit( home_url() ), get_bloginfo( 'name' ) ); 115 | 116 | // Determine which wrapping tags to use 117 | $wrap = is_home() && 'title' === genesis_get_seo_option( 'home_h1_on' ) ? 'h1' : 'h1'; 118 | 119 | // A little fallback, in case an SEO plugin is active 120 | $wrap = is_home() && ! genesis_get_seo_option( 'home_h1_on' ) ? 'h1' : $wrap; 121 | 122 | // And finally, $wrap in h1 if HTML5 & semantic headings enabled 123 | $wrap = genesis_html5() && genesis_get_seo_option( 'semantic_headings' ) ? 'h1' : $wrap; 124 | 125 | // Build the title 126 | $title = genesis_html5() ? sprintf( "
<{$wrap} %s>", genesis_attr( 'site-title' ) ) : sprintf( '<%s id="title">%s', $wrap, $inside, $wrap ); 127 | $title .= genesis_html5() ? "{$inside}" : ''; 128 | // Echo (filtered) 129 | echo apply_filters( 'genesis_seo_title', $title, $inside, $wrap ); 130 | 131 | } 132 | 133 | // Add drawer with title and menu after header 134 | add_action('genesis_after_header', 'gmdl_do_drawer_nav'); 135 | function gmdl_do_drawer_nav() { 136 | 137 | echo '
'; 138 | 139 | echo '
'; 140 | do_action( 'genesis_site_title' ); 141 | echo '
'; 142 | $menu_args = array( 143 | 'theme_location' => 'drawer', 144 | ); 145 | wp_nav_menu($menu_args); 146 | 147 | echo '
'; 148 | } 149 | 150 | -------------------------------------------------------------------------------- /lib/mdl/markup.php: -------------------------------------------------------------------------------- 1 | 'mdl-grid', 99 | 'sidebar-content-wrap' => 'mdl-grid', 100 | 'content' => 'mdl-cell mdl-shadow--4dp', 101 | 'sidebar-primary' => 'mdl-cell', 102 | 'sidebar-secondary' => 'mdl-cell', 103 | ), 104 | $context, 105 | $attr 106 | ); 107 | 108 | // populate $classes_array based on $classes_to_add 109 | $value = isset( $classes_to_add[ $context ] ) ? $classes_to_add[ $context ] : array(); 110 | 111 | if ( is_array( $value ) ) { 112 | $classes_array = $value; 113 | } else { 114 | $classes_array = explode( ' ', (string) $value ); 115 | } 116 | 117 | // apply any filters to modify the class 118 | $classes_array = apply_filters( 'gmdl-add-class', $classes_array, $context, $attr ); 119 | 120 | $classes_array = array_map( 'sanitize_html_class', $classes_array ); 121 | 122 | // append the class(es) string (e.g. 'span9 custom-class1 custom-class2') 123 | $attr['class'] .= ' ' . implode( ' ', $classes_array ); 124 | 125 | return $attr; 126 | } 127 | 128 | // remove unused layouts 129 | // genesis_unregister_layout( 'content-sidebar-sidebar' ); 130 | genesis_unregister_layout( 'sidebar-sidebar-content' ); 131 | //genesis_unregister_layout( 'sidebar-content-sidebar' ); 132 | 133 | function gmdl_layout_options_modify_classes_to_add( $classes_to_add ) { 134 | 135 | $layout = genesis_site_layout(); 136 | 137 | 138 | 139 | // full-width-content // supported 140 | if('full-width-content' === $layout){ 141 | $classes_to_add['content'] .= ' mdl-cell--12-col'; 142 | } 143 | 144 | // content-sidebar // default 145 | if ( 'content-sidebar' === $layout ) { 146 | $classes_to_add['content'] .= ' mdl-cell--8-col'; 147 | $classes_to_add['sidebar-primary'] .= ' mdl-cell--4-col mdl-cell--8-col-tablet mdl-grid'; 148 | } 149 | 150 | // sidebar-content 151 | if ( 'sidebar-content' === $layout ) { 152 | $classes_to_add['content'] .= ' mdl-cell--8-col mdl-cell--order-2-desktop'; 153 | $classes_to_add['sidebar-primary'] .= ' mdl-cell--4-col mdl-cell--8-col-tablet mdl-cell--order-1-desktop mdl-grid'; 154 | } 155 | 156 | // content-sidebar-sidebar 157 | if ( 'content-sidebar-sidebar' === $layout ) { 158 | $classes_to_add['content'] .= ' mdl-cell--6-col'; 159 | $classes_to_add['sidebar-primary'] .= ' mdl-cell--3-col mdl-cell--8-col-tablet mdl-grid'; 160 | $classes_to_add['sidebar-secondary'] .= ' mdl-cell--3-col mdl-cell--8-col-tablet mdl-grid'; 161 | } 162 | 163 | // sidebar-sidebar-content // not yet supported 164 | if ( 'sidebar-sidebar-content' === $layout ) { 165 | $classes_to_add['content'] .= ' mdl-cell--8-col-tablet mdl-cell--6-col mdl-cell--order-3-desktop'; 166 | $classes_to_add['sidebar-primary'] .= ' mdl-cell--3-col mdl-cell--8-col-tablet mdl-cell--order-1-desktop mdl-grid'; 167 | $classes_to_add['sidebar-secondary'] .= ' mdl-cell--3-col mdl-cell--8-col-tablet mdl-cell--order-2-desktop mdl-grid'; 168 | 169 | } 170 | 171 | // sidebar-content-sidebar 172 | if ( 'sidebar-content-sidebar' === $layout ) { 173 | $classes_to_add['content'] .= ' mdl-cell--8-col-tablet mdl-cell--6-col mdl-cell--order-2-desktop'; 174 | $classes_to_add['sidebar-primary'] .= ' mdl-cell--3-col mdl-cell--8-col-tablet mdl-cell--order-1-desktop mdl-grid'; 175 | $classes_to_add['sidebar-secondary'] .= ' mdl-cell--3-col mdl-cell--8-col-tablet mdl-cell--order-3-desktop mdl-grid'; 176 | } 177 | 178 | return $classes_to_add; 179 | }; 180 | 181 | function gmdl_modify_classes_based_on_template( $classes_to_add, $context, $attr ) { 182 | $classes_to_add = gmdl_layout_options_modify_classes_to_add( $classes_to_add ); 183 | 184 | return $classes_to_add; 185 | } 186 | 187 | 188 | function gmdl_widget_add_markup_class($params){ 189 | $params['before_widget'] = genesis_markup( array( 190 | 'html5' => '
', 191 | 'xhtml' => '
', 192 | 'echo' => false, 193 | ) ); 194 | return $params; 195 | } 196 | 197 | function gmdl_change_comments_button_class( $arg ) { 198 | $arg['class_submit'] = 'mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-color--accent mdl-color-text--accent-contrast'; 199 | // return the modified array 200 | return $arg; 201 | } 202 | 203 | -------------------------------------------------------------------------------- /lib/mdl/menu-walker.php: -------------------------------------------------------------------------------- 1 | 'menu_item_parent', 'id' => 'db_id' ); 23 | 24 | /** 25 | * Starts the list before the elements are added. 26 | * 27 | * @see Walker::start_lvl() 28 | * 29 | * @since 3.0.0 30 | * 31 | * @param string $output Passed by reference. Used to append additional content. 32 | * @param int $depth Depth of menu item. Used for padding. 33 | * @param array $args An array of arguments. @see wp_nav_menu() 34 | */ 35 | public function start_lvl( &$output, $depth = 0, $args = array() ) { 36 | $indent = str_repeat("\t", $depth); 37 | $output .= "\n$indent
    \n"; 38 | } 39 | 40 | /** 41 | * Ends the list of after the elements are added. 42 | * 43 | * @see Walker::end_lvl() 44 | * 45 | * @since 3.0.0 46 | * 47 | * @param string $output Passed by reference. Used to append additional content. 48 | * @param int $depth Depth of menu item. Used for padding. 49 | * @param array $args An array of arguments. @see wp_nav_menu() 50 | */ 51 | public function end_lvl( &$output, $depth = 0, $args = array() ) { 52 | $indent = str_repeat("\t", $depth); 53 | $output .= "$indent
\n"; 54 | } 55 | 56 | /** 57 | * Start the element output. 58 | * 59 | * @see Walker::start_el() 60 | * 61 | * @since 3.0.0 62 | * 63 | * @param string $output Passed by reference. Used to append additional content. 64 | * @param object $item Menu item data object. 65 | * @param int $depth Depth of menu item. Used for padding. 66 | * @param array $args An array of arguments. @see wp_nav_menu() 67 | * @param int $id Current item ID. 68 | */ 69 | public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { 70 | $indent = ( $depth ) ? str_repeat( "\t", $depth ) : ''; 71 | 72 | $classes = empty( $item->classes ) ? array() : (array) $item->classes; 73 | $classes[] = 'mdl-navigation__link menu-item-' . $item->ID; 74 | 75 | /** 76 | * Filter the CSS class(es) applied to a menu item's list item element. 77 | * 78 | * @since 3.0.0 79 | * @since 4.1.0 The `$depth` parameter was added. 80 | * 81 | * @param array $classes The CSS classes that are applied to the menu item's `
  • ` element. 82 | * @param object $item The current menu item. 83 | * @param array $args An array of {@see wp_nav_menu()} arguments. 84 | * @param int $depth Depth of menu item. Used for padding. 85 | */ 86 | $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item, $args, $depth ) ); 87 | $class_names = $class_names ? ' class="' . esc_attr( $class_names ) . '"' : ''; 88 | 89 | /** 90 | * Filter the ID applied to a menu item's list item element. 91 | * 92 | * @since 3.0.1 93 | * @since 4.1.0 The `$depth` parameter was added. 94 | * 95 | * @param string $menu_id The ID that is applied to the menu item's `
  • ` element. 96 | * @param object $item The current menu item. 97 | * @param array $args An array of {@see wp_nav_menu()} arguments. 98 | * @param int $depth Depth of menu item. Used for padding. 99 | */ 100 | $id = apply_filters( 'nav_menu_item_id', 'menu-item-'. $item->ID, $item, $args, $depth ); 101 | $id = $id ? ' id="' . esc_attr( $id ) . '"' : ''; 102 | 103 | $output .= $indent . ''; 104 | 105 | $atts = array(); 106 | $atts['title'] = ! empty( $item->attr_title ) ? $item->attr_title : ''; 107 | $atts['target'] = ! empty( $item->target ) ? $item->target : ''; 108 | $atts['rel'] = ! empty( $item->xfn ) ? $item->xfn : ''; 109 | $atts['href'] = ! empty( $item->url ) ? $item->url : ''; 110 | 111 | /** 112 | * Filter the HTML attributes applied to a menu item's anchor element. 113 | * 114 | * @since 3.6.0 115 | * @since 4.1.0 The `$depth` parameter was added. 116 | * 117 | * @param array $atts { 118 | * The HTML attributes applied to the menu item's `` element, empty strings are ignored. 119 | * 120 | * @type string $title Title attribute. 121 | * @type string $target Target attribute. 122 | * @type string $rel The rel attribute. 123 | * @type string $href The href attribute. 124 | * } 125 | * @param object $item The current menu item. 126 | * @param array $args An array of {@see wp_nav_menu()} arguments. 127 | * @param int $depth Depth of menu item. Used for padding. 128 | */ 129 | $atts = apply_filters( 'nav_menu_link_attributes', $atts, $item, $args, $depth ); 130 | 131 | $attributes = ''; 132 | foreach ( $atts as $attr => $value ) { 133 | if ( ! empty( $value ) ) { 134 | $value = ( 'href' === $attr ) ? esc_url( $value ) : esc_attr( $value ); 135 | $attributes .= ' ' . $attr . '="' . $value . '"'; 136 | } 137 | } 138 | 139 | $item_output = $args->before; 140 | $item_output .= ''; 141 | /** This filter is documented in wp-includes/post-template.php */ 142 | $item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after; 143 | $item_output .= ''; 144 | $item_output .= $args->after; 145 | 146 | /** 147 | * Filter a menu item's starting output. 148 | * 149 | * The menu item's starting output only includes `$args->before`, the opening ``, 150 | * the menu item's title, the closing ``, and `$args->after`. Currently, there is 151 | * no filter for modifying the opening and closing `
  • ` for a menu item. 152 | * 153 | * @since 3.0.0 154 | * 155 | * @param string $item_output The menu item's starting HTML output. 156 | * @param object $item Menu item data object. 157 | * @param int $depth Depth of menu item. Used for padding. 158 | * @param array $args An array of {@see wp_nav_menu()} arguments. 159 | */ 160 | $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args ); 161 | } 162 | 163 | /** 164 | * Ends the element output, if needed. 165 | * 166 | * @see Walker::end_el() 167 | * 168 | * @since 3.0.0 169 | * 170 | * @param string $output Passed by reference. Used to append additional content. 171 | * @param object $item Page data object. Not used. 172 | * @param int $depth Depth of page. Not Used. 173 | * @param array $args An array of arguments. @see wp_nav_menu() 174 | */ 175 | public function end_el( &$output, $item, $depth = 0, $args = array() ) { 176 | $output .= "
  • \n"; 177 | } 178 | 179 | } // Walker_Nav_Menu 180 | -------------------------------------------------------------------------------- /lib/mdl/menu.php: -------------------------------------------------------------------------------- 1 | theme_location || 'drawer' == $args->theme_location){ 50 | if( genesis_get_option( 'nav_extras' ) ) 51 | return $menu; 52 | $menu .= '' ; 53 | return $menu; 54 | } 55 | else{ 56 | return $menu; 57 | } 58 | } 59 | 60 | // Add mdl 'is-active' class for the current menu item 61 | if ( ! function_exists( 'gmdl_active_nav_class' ) ) : 62 | function gmdl_active_nav_class( $classes, $item ) { 63 | if ( 1 == $item->current || true == $item->current_item_ancestor ) { 64 | $classes[] = 'is-active'; 65 | } 66 | return $classes; 67 | } 68 | add_filter( 'nav_menu_css_class', 'gmdl_active_nav_class', 10, 2 ); 69 | endif; 70 | 71 | -------------------------------------------------------------------------------- /lib/mdl/pagination.php: -------------------------------------------------------------------------------- 1 | max_num_pages <= 1 ) 55 | return; 56 | 57 | $paged = get_query_var( 'paged' ) ? absint( get_query_var( 'paged' ) ) : 1; 58 | $max = intval( $wp_query->max_num_pages ); 59 | 60 | //* Add current page to the array 61 | if ( $paged >= 1 ) 62 | $links[] = $paged; 63 | 64 | //* Add the pages around the current page to the array 65 | if ( $paged >= 3 ) { 66 | $links[] = $paged - 1; 67 | $links[] = $paged - 2; 68 | } 69 | 70 | if ( ( $paged + 2 ) <= $max ) { 71 | $links[] = $paged + 2; 72 | $links[] = $paged + 1; 73 | } 74 | 75 | genesis_markup( array( 76 | 'html5' => '
    ', 77 | 'xhtml' => '' . "\n"; 119 | 120 | } 121 | -------------------------------------------------------------------------------- /lib/mdl/post.php: -------------------------------------------------------------------------------- 1 |

    '; 66 | 67 | $args['fields']['email'] = ''; 68 | 69 | $args['fields']['url'] = '

    '; 70 | 71 | $args['comment_field'] = '

    '; 72 | return $args; 73 | } 74 | -------------------------------------------------------------------------------- /lib/mdl/search.php: -------------------------------------------------------------------------------- 1 | ', genesis_attr( 'search-form' ) ); 25 | 26 | if ( '' == $label ) { 27 | $label = apply_filters( 'genesis_search_text', __( 'Search this website', 'genesis-material-design-lite-child-theme' ) ); 28 | } 29 | 30 | $form_id = uniqid( 'searchform-' ); 31 | 32 | $form .= sprintf( 33 | '
    ', 34 | home_url( '/?s={s}' ), 35 | esc_attr( $form_id ), 36 | esc_attr( $form_id ), 37 | $value_or_placeholder, 38 | esc_attr( $search_text ) 39 | ); 40 | 41 | 42 | } else { 43 | 44 | $form = sprintf( 45 | '