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 | |
namespace App\Console\Commands; | |
use Corcel\Model\Post; | |
use Illuminate\Console\Command; | |
use Statamic\Facades\Asset; | |
use Statamic\Facades\Entry; | |
class ImportWP extends Command |
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
/** | |
* Include variable for ImageDateTitle icon from core. Used in the Query Block Variation below | |
*/ | |
const external_wp_element_namespaceObject = window["wp"]["element"]; | |
const external_wp_components_namespaceObject = window["wp"]["components"]; | |
const imageDateTitle = (0, external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { | |
xmlns: "http://www.w3.org/2000/svg", | |
viewBox: "0 0 48 48" | |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { |
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 tell_all() { | |
global $wpdb; | |
$all_sites = $wpdb->get_col( "SELECT blog_id FROM {$wpdb->blogs} WHERE archived = FALSE" ); // Hide archived sites | |
$list = array(); | |
foreach( $all_sites as $site ) { | |
$args = array( | |
'blog_id' => $site, | |
'fields' => 'user_email', | |
'role' => 'Editor', | |
); |
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
// Add genesis layout classes to the Block Editor. | |
// File lives in the theme's /js/ folder. | |
wp.domReady(function () { | |
yourTheme.updateLayoutClass(); | |
var layouts = document.querySelector(".genesis-layout-selector"); | |
if( layouts ) { | |
layouts.addEventListener("input", function (e) { | |
yourTheme.updateLayoutClass(); |
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 | |
//* Add Bootstrap container class to header | |
function my_site_bootstrap_header( $attributes ) { | |
$attributes['class'] = $attributes['class']. ' container-fluid'; | |
return $attributes; | |
} | |
add_filter( 'genesis_attr_site-header', 'my_site_bootstrap_header' ); | |
//* Add Bootstrap container wrap around page content | |
function my_site_start_page_container(){ echo '<div id="page-container" class="container-fluid"><div class="row">'; }; |
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
## If your server has a redirect problem with | |
## .htpasswds protection on wp-admin directory, add the following: | |
ErrorDocument 401 default | |
## ------- UNSET PRAGMA ------ | |
## https://www.mnot.net/cache_docs/#PRAGMA |
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 | |
if ( ! defined( 'ABSPATH' ) ) die('-1'); | |
/* | |
* WDG-customized version of the Events Calendar Pro mini calendar widget. | |
* Changes are noted inline. | |
* Replacing class name: Tribe__Events__Pro__Mini_CalendarWidget | |
*/ | |
class MultisiteTribeEventsProMiniCalendarWidget extends WP_Widget { | |
function __construct() { |
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 | |
// Add this to your functions.php file, excluding the opening <?php | |
add_action( 'wp_head', 'nd_remove_homepage_blog' ); | |
// Remove blog section from homepage | |
function nd_remove_homepage_blog() { | |
if ( is_front_page() || is_home() ) { | |
remove_action( 'genesis_loop', 'genesis_do_loop' ); | |
} | |
} |
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
{ | |
"config": { | |
"exclude": [ | |
".git/**", | |
"node_modules/**" | |
], | |
"verbose": true, | |
"always-semicolon": true, | |
"block-indent": "\t", |
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
/*** | |
* Gravity Forms: Validate to ensure date fields are not the same or todays date | |
* | |
* This will validate the fields on form submission and return a validation error on the fields in question. | |
* In this case it validates an Arrival and Departure date against each other and today's date. | |
* | |
* Code goes in your theme's functions.php file. | |
***/ | |
add_filter('gform_field_validation','validate_dates',10,4); |
NewerOlder