This file contains 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 is a template used by 6 posts within a CPT | |
- Each post contains some text in the content editor and an ACF Gallery. | |
- Each image is tagged with category(ies) using Enhanced Media Library plugin. | |
- The categories used on each page are being echoed out to provide a means to filter the images. | |
- The lightbox being used is http://photoswipe.com | |
- The filter is done with http://isotope.com | |
- Included with the Isotope integration is https://github.com/desandro/imagesloaded |
This file contains 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 | |
/** | |
* Detect if a WordPress plugin is active | |
* A function you can use to check if plugin is active/loaded for your plugins/themes | |
* @link //gist.github.com/llgruff/c5666bfeded5de69b1aa424aa80cc14f | |
*/ | |
// When coding plugins that rely on another one, like Private Content for bbPress or Visual Attributes for WooCommerce, you need to make if the WordPress Plugin is active to initialize your plugin routines or display a notice saying that the required plugin must be activated. In this tutorial we’ll see how to detect whether a certain plugin is active in a couple of ways. | |
## 1. Check whether a certain class or function or constant exists |
This file contains 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
Show hidden characters
// UPDATED VERSION | |
{ | |
"filename_filter": "(/|\\\\|^)(?!_)(\\w+)\\.(css|js|sass|less|scss)$", | |
"build_on_save": 1 | |
} | |
// DEFAULT (for reference, in case you need it back) | |
{ | |
"filename_filter": "\\.(css|js|sass|less|scss)$", | |
"build_on_save": 1 |
This file contains 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
{ | |
"cmd": [ | |
"sass", "--update", "--watch", "$file:${file_path}/${file_base_name}.css", "--sourcemap=none", "--stop-on-error", "--no-cache", "--style", "expanded", | |
"&", | |
"sass", "--update", "$file:${file_path}/${file_base_name}.min.css", "--stop-on-error", "--no-cache", "--style", "compressed" | |
], | |
"selector": "source.sass, source.scss", | |
"line_regex": "Line ([0-9]+):", |
This file contains 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
/** | |
* First of all change prefix if you have different one. As default WordPress has `wp_` | |
*/ | |
// Update home and siteurl. | |
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
// Update posts guid. | |
UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl'); |
This file contains 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
function fa_icons() { | |
return array ( | |
'fab fa-500px' => __( '500px', 'buildr' ), | |
'fab fa-accessible-icon' => __( 'accessible-icon', 'buildr' ), | |
'fab fa-accusoft' => __( 'accusoft', 'buildr' ), | |
'fas fa-address-book' => __( 'address-book', 'buildr' ), | |
'far fa-address-book' => __( 'address-book', 'buildr' ), | |
'fas fa-address-card' => __( 'address-card', 'buildr' ), | |
'far fa-address-card' => __( 'address-card', 'buildr' ), |
This file contains 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
"use strict"; | |
// Load plugins | |
const autoprefixer = require("autoprefixer"); | |
const browsersync = require("browser-sync").create(); | |
const cp = require("child_process"); | |
const cssnano = require("cssnano"); | |
const del = require("del"); | |
const eslint = require("gulp-eslint"); | |
const gulp = require("gulp"); |
This file contains 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 | |
class CSVStream { | |
/** | |
* List of available source fields. | |
* | |
* @var array | |
*/ | |
protected $fields = array(); |
This file contains 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 example will add a custom "select" drop down to the "Image Box" | |
// This will change the class="" on the rendered image box so we can style the Image Box differently | |
// based on the selected option from the editor. | |
// The class will be "my-image-box-style-blue" or "my-image-box-style-green" based on the selected option. | |
add_action('elementor/element/before_section_end', function( $section, $section_id, $args ) { | |
if( $section->get_name() == 'image-box' && $section_id == 'section_image' ){ | |
// we are at the end of the "section_image" area of the "image-box" | |
$section->add_control( |