Skip to content

Instantly share code, notes, and snippets.

View stuartduff's full-sized avatar

Stuart Duff stuartduff

View GitHub Profile
@stuartduff
stuartduff / serachform-color.css
Created August 2, 2012 14:54
Search Form Colour Change
#searchform input.field {
background:black;
color:white;
}
#searchform input.submit {
background:black;
}
@stuartduff
stuartduff / canvas-info-hook.php
Created August 4, 2012 16:40
canvas cutome author box hook
add_filter('woo_loop_before', 'top_information_box',10,3);
function top_information_box() { ?>
<?php if ( is_home() ) { ?>
<div id="top-info-box">
<div class="author-image">
<img src="http://a0.twimg.com/profile_images/2353997708/fwabgtl1515lrlnucwul.jpeg" />
</div>
<h2>Extra Info Box</h2>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
@stuartduff
stuartduff / canvas-advert-banner.php
Created August 6, 2012 09:45
Canvas Header Advert Banner
add_filter('woo_header_before', 'top_information_box',10,3);
function top_information_box() { ?>
<div id="top-advert-banner">
<img src="http://www.linuxhpc.org/images/samples/468x60.gif" />
</div>
<?php }
@stuartduff
stuartduff / canvas-shortcode-file-permissions.txt
Created August 8, 2012 12:18
Test Canvas Sgortcode File Permissions
wp-content/themes/canvas/functions/js/shortcode-generator/dialog.php
@stuartduff
stuartduff / woo-custom-single-post-breadcrumb.php
Created August 9, 2012 22:55
woo custom single post breadcrumbs
add_filter( 'woo_breadcrumbs_args', 'woo_custom_single_post_breadcrumbs', 10, 1);
add_filter( 'woo_breadcrumbs_trail', 'woo_custom_single_post_breadcrumbs', 10, 1);
function woo_custom_single_post_breadcrumbs( $crumbs ) {
if ( is_singular() && ( 'post' == get_post_type() ) ) {
$crumbs['separator'] = '|'; // Separator change to pipe
$category = get_the_category();
$category_link = '<a href="' . get_category_link( $category[0]->term_id ) . '" title="'. $category[0]->name .'">'. $category[0]->name .'</a>';
@stuartduff
stuartduff / ninja-notebox.php
Created August 9, 2012 23:04
ninja notebox
add_action('woo_loop_before', 'top_info_box');
function top_info_box() {
if ( is_category( 'uncategorized' ) ) {
echo do_shortcode('[box type="note"]This is a note box[/box]');
}
}
@stuartduff
stuartduff / ellipsis.css
Created August 14, 2012 15:09
Truncate String with Ellipsis
.your-css-class {
width: 250px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
-o-text-overflow: ellipsis; /* required for Opera */
-ms-text-overflow: ellipsis; /* required for IE8, allegedly */
-moz-binding: url('ellipsis.xml#ellipsis'); /* for Firefox; details here */
}
@stuartduff
stuartduff / wc-out-of-stock-url.php
Created August 21, 2012 13:04
Add URL Link To WooCommerce Out Of Stock Products
add_action('woocommerce_single_product_summary','woo_custom_out_of_stock', 35);
function woo_custom_out_of_stock() {
global $woocommerce, $product;
$availability = $product->get_availability();
if ($availability['availability']) :
echo '<a style="color:#000" href="http://yourpageurl.com" title="your link title">Reserve Your Place</a>';
endif;
}
@stuartduff
stuartduff / can-slide-permalinks-remove.php
Created August 23, 2012 11:13
Remove Canvas Magazine Slider Permalinks
@stuartduff
stuartduff / gist:3450465
Created August 24, 2012 13:20
Indent Canvas Mobile Child Navigation
@media only screen and (max-width: 768px) {
#main-nav li ul.children li {padding-left:20px;}
}