Skip to content

Instantly share code, notes, and snippets.

View mjepson's full-sized avatar

Magnus Jepson mjepson

View GitHub Profile
<?php
$woo_options = get_option( 'woo_options' );
/*------------------------------------------------------------------------------------
TABLE OF CONTENTS
- Theme Setup
- Woo Conditionals
- Add Google Maps to HEAD
// Available Google webfont names
$google_fonts = array(
array( 'name' => "ABeeZee", 'variant' => ':300,300italic,400,400italic,700,700italic'),
array( 'name' => "Abel", 'variant' => ':300,300italic,400,400italic,700,700italic'),
array( 'name' => "Abril Fatface", 'variant' => ':300,300italic,400,400italic,700,700italic'),
array( 'name' => "Aclonica", 'variant' => ':300,300italic,400,400italic,700,700italic'),
array( 'name' => "Acme", 'variant' => ':300,300italic,400,400italic,700,700italic'),
array( 'name' => "Actor", 'variant' => ':300,300italic,400,400italic,700,700italic'),
array( 'name' => "Adamina", 'variant' => ':300,300italic,400,400italic,700,700italic'),
array( 'name' => "Advent Pro", 'variant' => ':300,300italic,400,400italic,700,700italic'),
@mjepson
mjepson / gist:6681031
Created September 24, 2013 06:28
Remove RSS feed
add_action( 'after_setup_theme', 'custom_remove_feed' );
if ( ! function_exists( 'custom_remove_feed' ) ) {
function custom_remove_feed () {
// Remove default posts and comments RSS feed links to head
remove_theme_support( 'automatic-feed-links' );
}
}
@mjepson
mjepson / gist:5915855
Created July 3, 2013 06:30
Line 74-77 is new
/*-----------------------------------------------------------------------------------*/
/* Add layout to body_class output */
/*-----------------------------------------------------------------------------------*/
if ( ! function_exists( 'woo_layout_body_class' ) ) {
function woo_layout_body_class( $classes ) {
global $post, $wp_query, $woo_options;
$layout = '';
// Single post layout
if ( is_singular() ) {
/*-----------------------------------------------------------------------------------*/
/* Function to optionally remove responsive design and load in fallback CSS styling. */
/*-----------------------------------------------------------------------------------*/
if ( ! function_exists( 'woo_remove_responsive_design' ) ) {
/**
* Trigger items for removing responsive design from Canvas.
* @since 5.0.13
* @return void
*/
/*
WOO CUSTOM STYLESHEET
---------------------
Instructions:
Add your custom styles in this file instead of style.css so it
is easier to update the theme. Simply copy an existing style
from style.css to this file, and modify it to your liking. */
/*-----------------------------------------------------------------------------------*/
/* Single Post Author */
/*-----------------------------------------------------------------------------------*/
if ( ! function_exists( 'woo_author_box' ) ) {
function woo_author_box () {
global $post;
$author_id=$post->post_author;
?>
<aside id="post-author">
<div class="profile-image"><?php echo get_avatar( $author_id, '80' ); ?></div>
add_action( 'woo_head', 'custom_more', 10 );
function custom_more() {
if ( is_page_template( 'template-news.php' ) ) {
add_action( 'woo_post_inside_after', 'woo_post_more' );
}
}
$args = array( 'post_type' => 'product',
'posts_per_page' => 100,
'meta_query' => array( 'key' => '_visibility',
'value' => array('catalog', 'visible'),
'compare' => 'IN'
)
);
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
function custom_ad_header () {
?>
<div style="float:left;"><?php echo adrotate_group(4); ?></div>
<?php
}
add_action( 'woo_header_inside', 'custom_ad_header', 1 );