This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const path = require('path'); | |
| const webpack = require('webpack'); | |
| const {CleanWebpackPlugin} = require('clean-webpack-plugin'); | |
| const HtmlWebPackPlugin = require('html-webpack-plugin'); | |
| const StartServerPlugin = require('start-server-webpack-plugin'); | |
| const NodemonPlugin = require('nodemon-webpack-plugin'); | |
| const SimpleProgressWebpackPlugin = require('simple-progress-webpack-plugin'); | |
| const FriendlyErrorsWebpackPlugin = require('friendly-errors-webpack-plugin'); | |
| const config = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # DO NOT run the line 167 standalone. It will remove the necessary files besides the junk! | |
| if echo $@|grep -q "\-\-help\|\-help\|\-h\|help\|\-\-h\|\-\-no\-deb\|\-\-no\-install\|\-\-no\-cleaning\|\-\-assume\-debian" | |
| then : | |
| else echo wrong entry\(ies\) ! | |
| help=yes | |
| fi | |
| if echo $@|grep -q "\-\-help\|\-help\|\-h\|help\|\-\-h" || [ "$help" = yes ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| Plugin Name: Google Analytics Tracking Code MU-Plugin | |
| Description: A must-use plugin that adds immutable Google Analytics tracking code. | |
| */ | |
| /* This plugin is used to ensure that Google Analytics is always present on the site (thus the use of a mu-plugin) | |
| and to maintain the relationship between WordPress themes (design) and WordPress plugins (functionality) by keeping this | |
| code out of the theme and in a plugin. */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Core User API | |
| * | |
| * @package WordPress | |
| * @subpackage Users | |
| */ | |
| /** | |
| * Authenticates and logs a user in with 'remember' capability. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //----------------------------------------// | |
| // Making jQuery load from Google Library // | |
| //----------------------------------------// | |
| add_filter( 'init', 'replace_default_jquery_with_fallback'); | |
| function replace_default_jquery_with_fallback() { | |
| if (is_admin()) { | |
| return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # WordPress WP-CLI cheat sheet | |
| # Reset everything in case of bugs | |
| wp transient delete --all && wp rewrite flush && wp cache flush | |
| # or in Lando | |
| lando wp transient delete --all && lando wp rewrite flush && lando wp cache flush | |
| # reset a new install | |
| wp plugin delete $(wp plugin list --status=inactive --field=name) | |
| wp theme delete $(wp theme list --status=inactive --field=name) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // This mixin can be used to provide Fluid Type behaviour accross your entire web page | |
| // or to a single css selector | |
| // | |
| // Full credit goes to Geoff Graham @ https://css-tricks.com/snippets/css/fluid-typography/ | |
| // | |
| // To apply globally: | |
| // | |
| // 1. Define your minimum and maximum screen widths | |
| // 2. Define your min and max font size for H1 element in px | |
| // 3. Apply fluid-type mixin to root element eg. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| <?php | |
| if ( has_post_thumbnail() ) { | |
| echo wp_get_attachment_image(get_post_thumbnail_id($post->ID), '', false, array('class' => 'featured-image')); | |
| } else { | |
| echo '<img src="' . get_bloginfo( 'stylesheet_directory' ) | |
| . '/library/images/thumbnail-default.jpg" alt="default thumb" class="featured-image"/>'; | |
| } | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ACF Google Maps Rendering | |
| (function ($) { | |
| /* | |
| * new_map | |
| * | |
| * This function will render a Google Map onto the selected jQuery element | |
| * | |
| * @type function | |
| * @date 8/11/2013 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function loop_shortcode($atts) { | |
| //Query the posts, the parameters can be edited | |
| $queried_posts = new WP_Query(array( | |
| 'post_type' => 'post-type', | |
| 'posts_per_page' => -1, | |
| 'order' => 'ASC' | |
| )); | |