Skip to content

Instantly share code, notes, and snippets.

@JimiWikman
JimiWikman / Open Graph for WooCommerce
Created July 27, 2014 02:37
Open Graph for WooCommerce
<?php if ( is_home() ) { // If on the homepage ?>
<!--/ Open Graph for Homepage /-->
<meta property="og:title" content="<?php echo get_bloginfo(strip_tags('name')) ?>" />
<meta property="og:type" content="website" />
<meta property="og:url" content="<?php echo home_url() ?>" />
<meta property="og:description" content="<?php echo get_bloginfo (strip_tags('description')) ?>" />
<meta property="og:site_name" content="<?php echo get_bloginfo(strip_tags('name')) ?>" />
<meta property="og:image" content="http://unglove.me/path-to-thumbnail-image.jpg" />
<?php } ?>
<?php if ( is_woocommerce() ) { // If on a woocommerce page ?>
@JimiWikman
JimiWikman / How to disable Disqus on WordPress custom post types
Last active August 29, 2015 14:04
How to disable Disqus on WordPress custom post types
//Prevent Disqus from blocking the WooCommerce Review form on product pages.
//place the following code into the disqus.php, line 151
//Find line 149 and you’ll see the following.
//
// $replace = get_option('disqus_replace');
// if ( is_feed() ) { return false; }
// if ( 'draft' == $post->post_status ) { return false; }
// if ( !get_option('disqus_forum_url') ) { return false; }
// else if ( 'all' == $replace ) { return true; }
//
<?php
function show_image_sizes( $sizes ) {
$new_sizes = array();
$added_sizes = get_intermediate_image_sizes();
// $added_sizes is an indexed array, therefore need to convert it
// to associative array, using $value for $key and $value
foreach( $added_sizes as $key => $value) {