Skip to content

Instantly share code, notes, and snippets.

View woogist's full-sized avatar

WooCommerce.com Documentation woogist

View GitHub Profile
$args = array(
'post_type' => 'post'
);
$args = array(
'post_type' => 'post',
'category_name' => uncategorized
);
@woogist
woogist / gist:5480269
Created April 29, 2013 07:57
Display a slider of related posts at the bottom of a post. Posts are filtered by both tags and categories.
/*
* Woo Related posts slider hooked on woo_post_after
*/
function woo_related_posts_slider() {
global $post;
if( is_single() ){
$extra_args = array();
@woogist
woogist / gist:5480273
Created April 29, 2013 07:59
Shortcode to display related posts
/*
* Woo Related Posts Slider Shortcode
*/
function woo_related_posts_slider($atts) {
global $post;
extract( shortcode_atts( array(
'tags' => 'true',
'cats' => 'true',
@woogist
woogist / gist:5480279
Created April 29, 2013 08:00
Related Posts Slider Widget
<?php
/*
Plugin Name: WooSlider - Related Posts Slider
Plugin URI: http://woothemes.com/
Description: Related Posts WooSlider slideshow.
Version: 1.0.0
Author: WooThemes
Author URI: http://woothemes.com/
License: GPL version 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*/
@woogist
woogist / gist:5482357
Created April 29, 2013 15:29
Add social Icons to Canvas v5.2 header php logic
add_filter( 'woo_header_inside', 'woo_custom_social_links', 10 );
function woo_custom_social_links () {
global $woo_options;
$settings = array(
'feed_url' => '',
'connect_rss' => '',
'connect_twitter' => '',
'connect_facebook' => '',
@woogist
woogist / gist:5482370
Created April 29, 2013 15:30
Add CSS for social icons in Canvas v5.2 header
#header .social {float:right;}
#header .social a {
filter: alpha(opacity=@opacity * 100);
-moz-opacity: 0.8;
-khtml-opacity: 0.8;
opacity: 0.8;
-webkit-transition: all ease-in-out 0.2s;
-moz-transition: all ease-in-out 0.2s;
-o-transition: all ease-in-out 0.2s;
@woogist
woogist / gist:5489295
Created April 30, 2013 15:02
Css for adding Canvas v5.2 social icons to the Primary Navigation Area
#navigation .social {float:right;margin:0.35em 0.5em 0 0;}
#navigation .social a {
filter: alpha(opacity=@opacity * 100);
-moz-opacity: 0.8;
-khtml-opacity: 0.8;
opacity: 0.8;
-webkit-transition: all ease-in-out 0.2s;
-moz-transition: all ease-in-out 0.2s;
-o-transition: all ease-in-out 0.2s;
@woogist
woogist / gist:5489304
Created April 30, 2013 15:03
Function for adding Canvas v5.2 social icons to the Primary Navigation Menu
add_filter( 'woo_nav_inside', 'woo_custom_social_links', 5 );
function woo_custom_social_links () {
global $woo_options;
$settings = array(
'feed_url' => '',
'connect_rss' => '',
'connect_twitter' => '',
'connect_facebook' => '',
@woogist
woogist / gist:5494640
Created May 1, 2013 10:36
Add logic to add social icons to hustle header
add_filter( 'woo_header_inside', 'woo_custom_social_links', 10 );
function woo_custom_social_links() {
global $woo_options;
//Setup default variables, overriding them if the "Theme Options" have been saved.
$settings = array(
'feed_url' => '',
'connect_rss' => '',
'connect_twitter' => '',