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
RewriteEngine On | |
RewriteRule ^img.jpg http://remotesite/img.jpg |
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 | |
/** | |
* Theme Fonts - A script to allow users to select theme fonts. | |
* | |
* Theme Fonts was created to give theme developers an easy way to include multiple font settings | |
* and multiple font choices to their users. It's main purpose is to provide integration into the | |
* WordPress theme customizer to allow for the selection of fonts. The script will work with basic | |
* Web-safe fonts, custom fonts added to the theme, and fonts from Google Web Fonts. | |
* | |
* This program is free software; you can redistribute it and/or modify it under the terms of the GNU |
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_filter( 'woocommerce_variable_price_html', 'djr_price_filter', 10, 2 ); | |
add_filter( 'woocommerce_variable_sale_price_html', 'djr_price_filter', 10, 2 ); | |
/** | |
* Filters woocommerce_variable_price_html and woocommerce_variable_sale_price_html to apply text | |
* of Starting from instead of the price range from - to that is the woocommerce default | |
* | |
* @param $price | |
* @param $product | |
* | |
* @return string |
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 | |
/** | |
* Filters frontpage_template to allow both front-page.php as default static front page template while allowing | |
* users to select a different template in page options, also removes front-page.php from being used for the blog index | |
* From discussion in https://themehybrid.slack.com/archives/general/p1474838117000393 | |
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html | |
*/ | |
function prefix_front_page_template( $template ) { | |
return ( is_home() || locate_template( get_page_template_slug() ) ) ? '' : $template; |
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 | |
/** | |
* Example code for adding custom shortcodes for WP-Lister Pro for Amazon | |
*/ | |
/** | |
* Returns value to output in wpla shortcode | |
* | |
* @param $post_id | |
* @param $product |
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 | |
/** | |
* remove search rules so that we can use /search/slug/ as a page | |
* | |
* @param $rules | |
* | |
* @return mixed | |
*/ | |
function prefix_links_remove_search($rules){ |
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 | |
/** | |
* Client wants only logged in users to see prices and buy non-sale items while allowing all users to see prices and buy | |
* on sale items | |
*/ | |
/** | |
* | |
* filters woocommerce_is_purchasable for not onsale items | |
* |
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
//filter color display to maybe add hash to hex colors | |
add_filter( 'facetwp_facet_render_args', function( $args ) { | |
if ( 'colors' == $args['facet']['name'] ) { | |
foreach ( $args['values'] AS $key => $value ) { | |
$args['values'][$key]['facet_display_value'] = ( '' != ( $color = sanitize_hex_color_no_hash( $value['facet_display_value'] ) ) ) ? '#' . $color : $value['facet_display_value']; | |
} | |
} | |
return $args; | |
}); |
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 | |
/** | |
* filter html for sort output to output radio buttons | |
*/ | |
add_filter( 'facetwp_sort_html', function( $html, $params ) { | |
$html = ''; | |
foreach ( $params['sort_options'] as $key => $atts ) { | |
$html .= '<input type="radio" name="custom-sort" value="' . $key . '">' . $atts['label'] . '<br>'; | |
} |
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
/** | |
* custom sort order for a facet, this orders by facet_display_value but facet_value could also be used | |
**/ | |
add_filter( 'facetwp_facet_orderby', function( $orderby, $facet ) { | |
if ( 'colors' == $facet['name'] ) { // change colors to the name of the facet | |
$orderby = "FIELD(f.facet_display_value, 'Blue','Green','Red', 'Gray')"; | |
} | |
return $orderby; | |
}, 10, 2 ); |
OlderNewer