Skip to content

Instantly share code, notes, and snippets.

View qstudio's full-sized avatar

Ray qstudio

View GitHub Profile
<?php
namespace q\theme\child\context;
use q\theme\core\helper as h;
// register class to willow ##
\q\theme\child\context\ui::__run();
class ui {
git submodule deinit -f wp-content/plugins/REPO
rm -rf .git/modules/wp-content/plugins/REPO/
git rm -r --cached wp-content/plugins/REPO
rm -rf wp-content/plugins/REPO/
git commit -m "Removed PLUGIN REPO"
git submodule add -f https://github.com/USER/REPO wp-content/plugins/REPO
git commit -m "Added PLUGIN REPO"
// add form inputs ##
function add_honey( e ) {
jQuery( '.form' ).append( '<input type="text" name="honey" id="honey" data-form-mel-input tabindex="-1" autocomplete="false" data-form-required value="" />' );
}
// scan for forms to validate ##
[ "DOMContentLoaded" ].forEach(function(e){
window.addEventListener( e, add_honey, false );
});
// return an array ##
return [ 'post' => [
'config' => [
// run context->task ##
'run' => true,
// context->task debugging ##
'debug' => false,
<?php
/**
* The main template file
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* E.g., it puts together the home page when no home.php file exists.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
<?php
if ( have_posts() ) :
while ( have_posts() ) : the_post();
the_title( '<h2>', '</h2>' );
the_post_thumbnail();
the_excerpt();
endwhile;
else:
_e( 'Sorry, no posts matched your criteria.', 'textdomain' );
endif;
@qstudio
qstudio / index.willow
Last active September 29, 2020 20:05
{~ ui~header ~}
{~ ui~open ~}
<div class="col-12 col-lg-8">
<div class="row">
{~ post~title {+ "<h1 class='col-12'>{{ title }}</h1>" +} ~}
{~ post~excerpt ~}
<?php
// hook into the script_loader_tag filter, but not in the admin ##
if ( ! \is_admin() ) {
\add_filter( 'style_loader_tag', 'q_script_loader_tag', 0, 3 );
}
// add the filter function - passing 4 params ##
<?php
// hook into the style_loader_tag filter, but not in the admin ##
if ( ! \is_admin() ) {
\add_filter( 'style_loader_tag', 'q_style_loader_tag', 0, 4 );
}
// add the filter function - passing 4 params ##
'use strict';
module.exports = function(grunt) {
// root path to mode_modules - crude, but stable ##
var $root_path = '../../../';
// Load Tasks ##
grunt.loadTasks( $root_path+'node_modules/grunt-contrib-uglify/tasks'); // UGLIFY / Minify JS ##