Skip to content

Instantly share code, notes, and snippets.

View woogist's full-sized avatar

WooCommerce.com Documentation woogist

View GitHub Profile
function woo_shortcode_post_comments ( $atts ) {
global $post;
$defaults = array(
'zero' => 'No Comments',
'one' => 'One Comment',
'more' => '% Comments',
'hide_if_off' => 'enabled',
'closed_text' => apply_filters( 'woo_post_more_comment_closed_text', __( 'Comments are closed', 'woothemes' ) ),
'before' => '',
@woogist
woogist / gist:5765835
Created June 12, 2013 14:35
Display only top level categories on the On Topic home page.
<?php
if ( ! defined( 'ABSPATH' ) ) exit;
/**
* Topics Grid Template
*
* Here we setup all HTML pertaining to the topics grid.
*
* @package WooFramework
* @subpackage Template
*/
@woogist
woogist / gist:5769361
Last active December 18, 2015 10:29
Add custom url to function slider title
function woo_metaboxes_add($woo_metaboxes) {
$woo_metaboxes[] = array(
"name" => "url",
"label" => "Custom Slider URl",
"type" => "text",
"desc" => "Enter a custom URL for the slide title here"
);
return $woo_metaboxes;
@woogist
woogist / gist:5769415
Created June 12, 2013 21:47
Function slider post meta code
<?php thedate( get_option( 'date_format' ) ); echo ' • '; the_time( get_option( 'time_format' ) ); echo ' • '; the_author_posts_link(); if ( comments_open() ) { echo ' • '; comments_popup_link( _( 'Leave a comment', 'woothemes' ), _( '1 Comment', 'woothemes' ), _( '% Comments', 'woothemes' ) ); } ?>
@woogist
woogist / gist:5769423
Created June 12, 2013 21:48
WordPress the_excerpt() function
<?php the_excerpt(); ?>
@woogist
woogist / new_gist_file
Last active December 18, 2015 10:59
List description under the canvas menu items
class description_walker extends Walker_Nav_Menu
{
function start_el(&$output, $item, $depth, $args)
{
global $wp_query;
$indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';
$class_names = $value = '';
$classes = empty( $item->classes ) ? array() : (array) $item->classes;
@woogist
woogist / new_gist_file
Created June 13, 2013 08:36
Style the canvas men description
#navigation #main-nav .menu-item span.description {
display: block;
font-size: 11px;
font-style: italic;
}
@woogist
woogist / gist:5772447
Created June 13, 2013 09:33
Add the “Business” slider to the default Canvas homepage
// Display the "Business" slider above the default WordPress homepage.
add_action( 'get_header', 'woo_custom_load_biz_slider', 10 );
function woo_custom_load_biz_slider () {
if ( is_front_page() && ! is_paged() ) {
add_action( 'woo_main_before_home', 'woo_slider_biz', 10 );
add_action( 'woo_main_before_home', 'woo_custom_reset_biz_query', 11 );
add_action( 'woo_load_slider_js', '__return_true', 10 );
add_filter( 'body_class', 'woo_custom_add_business_bodyclass', 10 );
}
<?php
/**
* Template Name: Business
*
* The business page template displays your posts with a "business"-style
* content slider at the top.
*
* @package WooFramework
* @subpackage Template
*/
@woogist
woogist / gist:5788029
Created June 15, 2013 12:49
Scrollider No Slider Scroll
#content-top {
position:absolute !important;
height:400px !important;
}