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 ( isset( $_SERVER['REQUEST_URI'] ) && in_array( substr( $_SERVER['REQUEST_URI'], -4 ), array( '.xml', '.xsl' ) ) ) { | |
remove_all_actions( 'widgets_init' ); | |
} |
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 | |
/** | |
* Make the `vc_raw_html` shortcodes content available to the video seo plugin for indexing. | |
* | |
* @param string $content The post content | |
* | |
* @return string | |
*/ | |
function yst_make_raw_html_detectable( $content ) { |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> | |
<html> | |
<head> | |
<script type="text/javascript"> | |
function showGTitle() { | |
var gText1 = document.getElementById('gtext1pete').value; | |
var gBold1 = document.getElementById('gbold1pete').value; | |
var gWords1 = gBold1.split(' '); | |
for(var gI1=0; gI1<gWords1.length; gI1++) { |
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 | |
/** Replace the standard loop with our custom Locations loop */ | |
remove_action( 'genesis_loop', 'genesis_do_loop' ); | |
add_action( 'genesis_loop', 'wpseo_locations_archive_loop' ); | |
function wpseo_locations_archive_loop() { | |
echo '<h1>Locations</h1>'; | |
echo '<div class="entry-content"><p>Your intro text here.</p></div>'; | |
$args = 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
<?php | |
/** | |
* Prevent stupid plugins from running shutdown scripts when we're obviously not outputting HTML. | |
*/ | |
function really_die() { | |
global $wp_filter; | |
unset( $wp_filter['wp_footer'], $wp_filter['shutdown'] ); | |
$wp_filter['wp_footer'] = 1; | |
die(); | |
} |
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 | |
/** | |
* Make sure EDD doesn't trip over the NGINX values of global server settings and returns the proper current page URL. | |
* | |
* @param string $url The current page URL | |
* @return string The fixed current page URL. | |
*/ | |
function yst_fix_edd_current_page_url( $url ) { | |
if ( is_front_page() ) : | |
$page_url = home_url(); |
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 | |
/** | |
* Make sure the AJAX URL for EDD uses the protocol for the current page, either http or https, as it doesn't work otherwise. | |
* | |
* @param string $ajaxurl The current ajaxurl | |
* | |
* @return string | |
*/ | |
function yst_filter_edd_ajax_url( $ajaxurl ) { |
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 | |
/** | |
* Allow people to specify a coupon code in the URL, and add it to their cart. | |
*/ | |
function yst_edd_discount_link() { | |
if ( isset( $_GET['coupon'] ) ) { | |
// Check whether it's a valid coupon, if so, add it to the cart. | |
if ( edd_is_discount_valid( $_GET['coupon'] ) ) | |
edd_set_cart_discount( $_GET['coupon'] ); |
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 | |
/** | |
* Enable qTranslate for WordPress SEO | |
* | |
* @param string $text The string to translate | |
* | |
* @return string | |
*/ | |
function qtranslate_filter( $text ) { |
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 | |
/** | |
* Adds a bit of JS that moves the meta box for WP SEO below the ACF box. | |
*/ | |
function move_yoast_seo_below_acf_js() { | |
?> | |
<script type="text/javascript"> | |
jQuery(document).ready(function ($) { | |
if ( $('.acf_postbox').length > 0 && $('#wpseo_meta').length > 0 ) { |