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 | |
public function render_summary_report_widget() { | |
$not_hidden_queries = array( | |
'companies-dont-test' => array( | |
'post_type' => 'company', | |
'posts_per_page' => -1, | |
'suppress_filters' => 0, | |
'meta_query' => array( | |
array( | |
'key' => 'animal_testing_policy', |
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 | |
function filter_instant_articles_category_kicker( $category ) { | |
$category = ''; | |
return $category; | |
} | |
add_filter( 'instant_articles_cover_kicker', 'filter_instant_articles_category_kicker', 10, 1 ); | |
//maybe you can do this and return nothing? |
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 | |
//this goes in the bottom of your LOCAL config file | |
//these should already be set but in case they aren't: | |
//$env = $_SERVER['SERVER_NAME']; | |
//$domain = 'yourSiteName/'; | |
//$local_url = 'http://' . $env . '/' . $domain; | |
//define('WP_ENV', $env); | |
//define('WP_HOME', $local_url); | |
//define('WP_SITEURL', $local_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 | |
function woocommerce_subcategory_thumbnail( $category ) { | |
$small_thumbnail_size = apply_filters( 'single_product_small_thumbnail_size', 'shop_catalog' ); | |
$dimensions = wc_get_image_size( $small_thumbnail_size ); | |
$thumbnail_id = get_woocommerce_term_meta( $category->term_id, 'thumbnail_id', true ); | |
if ( $thumbnail_id ) { | |
$image = wp_get_attachment_image_src( $thumbnail_id, $small_thumbnail_size ); | |
$image = $image[0]; |
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 | |
$args = array( | |
'post_type' => 'post', | |
'posts_per_page' => -1, | |
); | |
$the_posts = get_posts($args); | |
foreach($the_posts as $single_post){ | |
$single_id = $single_post->ID; |
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
<script> | |
jQuery(document).ready(function($) { | |
$('iframe[src*="youtube.com"]').wrapAll('<div class="youtube-wrapper">'); | |
$('.youtube-wrapper').wrapAll('<div class="video-player">'); | |
}); | |
</script> | |
<style> | |
.video-player { | |
clear: both; |
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 | |
/** | |
* Seems like this is the best way to remove Foobox where it's not needed. According to this blog post the js file name changes, | |
* but it seems like they've made it consistent. However, I couldn't seem to get the CSS to go away. | |
* http://blackhillswebworks.com/2013/03/13/load-foobox-plugin-scripts-and-styles-only-when-needed/ | |
* Foobox told me on Twitter to try using the 'Exclude Foobox' button on the page itself, but it didn't give me the results I wanted: | |
* https://twitter.com/foobox/status/595741740994297856 | |
* @don | |
*/ | |
add_action( 'wp_print_scripts', 'disable_foobox_script', 100 ); |
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> | |
<html> | |
<head> | |
<title>Create wp-config.php file!</title> | |
<style type="text/css"> | |
label, | |
input{ | |
display:block; | |
width:50%; | |
font-size:150%; |
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 | |
function filter_image_url($url){ | |
$liveurl = 'http://www.siteurl.com/'; | |
$localurl = 'http://localhost/yourURL/'; | |
$url = str_replace($localurl, $liveurl, $url); | |
return $url; | |
} | |
add_filter('wp_get_attachment_url', 'filter_image_url'); |
NewerOlder