Skip to content

Instantly share code, notes, and snippets.

@tomharrigan
tomharrigan / intro
Created September 5, 2012 06:47
Adding a second intro message
<?php if ( ( $paged == 1 ) && ( ($settings['custom_intro_message'] == "true") || ($settings['custom_intro_message_two'] == "true")) ) { ?>
<section id="intro">
<?php if($settings['custom_intro_message'] == "true") { ?>
<div class="col-full">
<h1><?php echo stripslashes( $settings['custom_intro_message_text'] ); ?></h1>
</div>
<?php } if($settings['custom_intro_message_two'] == "true") { ?>
<div class="col-full">
<h1><?php echo stripslashes( $settings['custom_intro_message_text_two'] ); ?></h1>
</div>
@tomharrigan
tomharrigan / typography shortcode w leading
Created September 7, 2012 00:17
Typography shortcode with line-height addition in order to achieve leading. To use: [typography font=" " size=" " height=" " color=" "] [/typography]
function woo_shortcode_typography ( $atts, $content = null ) {
global $google_fonts;
// Get just the names of the Google fonts.
$google_font_names = array();
if ( count( $google_fonts ) ) {
foreach ( $google_fonts as $g ) {
@tomharrigan
tomharrigan / Peter
Created November 14, 2012 21:02
CSS for Peter
/* NEW ADDITIONS FOR LDP */
body {background:#e3e3e3}
body {background-image:url(http://www.ldpress.co.uk/wp-content/uploads/background-shade.png)}
body {background-repeat:repeat-x}
body {background-position:top left}
a.button, a.comment-reply-link, #commentform #submit {background:#d80819;border-color:#d80819}
a.button:hover, a.button.hover, a.button.active, a.comment-reply-link:hover, #commentform #submit:hover {background:#d80819;opacity:0.9;}
body, p { font:normal 11px/1.5em Arial, sans-serif;color:#555555; }
#navigation, #navigation .nav a { font:bold 12px/1.4em Arial, sans-serif;color:#555555; }
@tomharrigan
tomharrigan / Peter on Gradients
Created November 14, 2012 21:13
CSS with background gradient
/* NEW ADDITIONS FOR LDP */
body {background:#e3e3e3;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#b1b1b0', endColorstr='#e3e3e3');
background: -webkit-gradient(linear, left top, left bottom, from(#b1b1b0), to(#e3e3e3));
background: -moz-linear-gradient(top, #b1b1b0, #e3e3e3);
}
a.button, a.comment-reply-link, #commentform #submit {background:#d80819;border-color:#d80819}
a.button:hover, a.button.hover, a.button.active, a.comment-reply-link:hover, #commentform #submit:hover {background:#d80819;opacity:0.9;}
body, p { font:normal 11px/1.5em Arial, sans-serif;color:#555555; }
#navigation, #navigation .nav a { font:bold 12px/1.4em Arial, sans-serif;color:#555555; }
@tomharrigan
tomharrigan / vidslide
Created November 20, 2012 02:24
video slide content
<div style="float: right; padding-left: 30px; width: 350px;">
<div class="fluid-width-video-wrapper" style="padding-top: 56.285714285714285%;"><iframe style="" src="http://player.vimeo.com/video/40070437" frameborder="0" width="320" height="240"></iframe></div>
</div>
Scrollider offers loads of modules and flexibility in terms of layout and customizability. You can add even more modules though if you download and install our free plugin – WooDojo. WooDojo for example gives you a tabs widget to showcase popular and latest posts, latest comments and a tag cloud, Twitter and Instagram profiles and feeds, and maintenance mode and launch pad landing pages.
<a class="woo-sc-button large custom" href="http://www.woothemes.com/woodojo/"><span class="woo-">Find out more</span></a>
@tomharrigan
tomharrigan / athena_featured
Created November 21, 2012 01:11
Athena Featured
@tomharrigan
tomharrigan / widgettemplatesidebar
Created November 29, 2012 03:02
Register Widgets Template Sidebar
register_sidebar( array( 'name' => __( '"Widgets" Page Template', 'woothemes' ), 'id' => 'widgets-page-template', 'description' => __( 'The widgetized area used on the "Widgets" page template (displays only if widgets are added here). Defaults to page content if no widgets are added.', 'woothemes' ), 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>' ) );
@tomharrigan
tomharrigan / scrollidervdslide
Created November 29, 2012 21:02
scrollider video slide content
<div style="float: right; padding-left: 30px; width: 350px;">
<div class="fluid-width-video-wrapper" style="padding-top: 56.285714285714285%;"><iframe style="" src="http://player.vimeo.com/video/40070437" frameborder="0" width="320" height="240"></iframe></div>
</div>
Scrollider offers loads of modules and flexibility in terms of layout and customizability. You can add even more modules though if you download and install our free plugin – WooDojo. WooDojo for example gives you a tabs widget to showcase popular and latest posts, latest comments and a tag cloud, Twitter and Instagram profiles and feeds, and maintenance mode and launch pad landing pages.
<a class="woo-sc-button large custom" href="http://www.woothemes.com/woodojo/"><span class="woo-">Find out more</span></a>
@tomharrigan
tomharrigan / translatediner
Created December 11, 2012 08:00
translate
add_filter('gettext', 'translate_text');
add_filter('ngettext', 'translate_text');
function translate_text($translated) {
$translated = str_ireplace('Enter your current location below to generate directions to Diner.', 'Your Text Here', $translated);
return $translated;
}
@tomharrigan
tomharrigan / wc-4products
Last active December 10, 2015 02:19
4 products
// Change number or products per row to 4
add_filter( 'loop_shop_columns', 'woo_custom_loop_columns' );
if ( ! function_exists( 'woo_custom_loop_columns' ) ) {
function woo_custom_loop_columns() {
return 4;
} // End woo_custom_loop_columns()
}