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
location ~* \.(txt|log|xml|css|js)$ { | |
add_header X-Robots-Tag noindex; | |
} |
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
class Custom_Widget_Pods_Testimonials extends WP_Widget { | |
public function __construct() { | |
$widget_ops = array('classname' => 'widget_pods_testimonials', 'description' => __( "Featured Testimonials.") ); | |
parent::__construct('pods_testimonials', __('Featured Testimonials'), $widget_ops); | |
$this->alt_option_name = 'widget_pods_testimonials'; | |
add_action( 'save_post', array($this, 'flush_widget_cache') ); | |
add_action( 'deleted_post', array($this, 'flush_widget_cache') ); | |
add_action( 'switch_theme', array($this, 'flush_widget_cache') ); | |
} |
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 | |
add_action( 'pre_get_posts', function ( $query ) { | |
if ( $query->is_main_query() && !is_admin() && $query->is_post_type_archive( 'name_of_post_type') ) { | |
$query->set('orderby', 'meta_value_num'); | |
$query->set('meta_key', 'custom_field_name'); | |
$query->set('order', 'ASC'); | |
} | |
} |
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
INITIALISATION | |
============== | |
load wp-config.php | |
set up default constants | |
load wp-content/advanced-cache.php if it exists | |
load wp-content/db.php if it exists | |
connect to mysql, select db | |
load object cache (object-cache.php if it exists, or wp-include/cache.php if not) | |
load wp-content/sunrise.php if it exists (multisite only) |
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 (!function_exists('array_group_by')) { | |
/** | |
* Groups an array by a given key. | |
* | |
* Groups an array into arrays by a given key, or set of keys, shared between all array members. | |
* | |
* Based on {@author Jake Zatecky}'s {@link https://github.com/jakezatecky/array_group_by array_group_by()} function. | |
* This variant allows $key to be closures. |
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 | |
/** | |
* Woocommerce Custom Variation Output | |
* | |
* The following function allow for the theme to display product variations in a grid format. | |
* This code could be moved to a plugin but is in the theme function file as it used the | |
* themes grid system. | |
* | |
* @package WooGrid | |
* @since WooGrid 1.2 |
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 | |
/** | |
* | |
* This script will copy your wordpress from public_html (or wherever) | |
* and place it in a staging folder. | |
* It will then clone the database, reconfigure the config file | |
* and replace URL's from the original URL to your staging URL. | |
* It will then make sure to NOT allow search engines to index the page. | |
* | |
* Use this script to clone your main wp in order to test maintenance work |
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 | |
/* | |
* Add virtual Field Grouping to Pods | |
* This requires the PR from https://github.com/pods-framework/pods/pull/3548 which will hopefully be | |
* available in Pods 2.6.6 | |
* James Golovich <[email protected]> | |
*/ | |
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
/*! BeaverBuilder Add Panel Option for jQuery v1.00 | |
* http://www.badabing.nl/jquery-plugins/beaverbuilder-paneloptions/ | |
* Do not remove any of this notice (you're welcome to use this code in commercial projects) | |
* Copyright (c) 2016 Didou Schol www.badabing.nl | |
* Licensed under the MIT license */ | |
( function ( $ ) { | |
$.extend ({ | |
bbAddPanel: function ( options ) { | |
// DEFAULT OPTIONS |