Skip to content

Instantly share code, notes, and snippets.

View krogsgard's full-sized avatar

Brian Krogsgard krogsgard

View GitHub Profile
@krogsgard
krogsgard / mq.css
Created October 3, 2012 18:31 — forked from chriscoyier/mq.css
@media only screen and (min-width: 320px) {
/* Small screen, non-retina */
}
@media
only screen and (-webkit-min-device-pixel-ratio: 2) and (min-width: 320px),
only screen and ( min--moz-device-pixel-ratio: 2) and (min-width: 320px),
only screen and ( -o-min-device-pixel-ratio: 2/1) and (min-width: 320px),
@krogsgard
krogsgard / rsseries-filter.php
Created August 2, 2012 03:40
Filter Really Simple Series title like this
<?php
add_filter( 'rsseries_title', 'krogs_custom_series_title' );
function krogs_custom_series_title( $title ) {
$title = '<h5>' . __('My custom series title') . '</h5>';
return $title;
<?php
function child_byline( $byline ) {
global $post;
$byline = '<p class="byline">[entry-terms taxonomy="category"] | [entry-published] | [entry-comments-link zero="Leave a comment" one="1 comment" more="%1$s comments"] [entry-edit-link before=" | "] </p>';
return $byline;
}
@krogsgard
krogsgard / placeholder-image-override.php
Created July 10, 2012 20:23
Little more dev-site friendly
<?php
/*
* goes in theme functions.php or a custom plugin
*
**/
add_filter('woocommerce_placeholder_img_src', 'custom_woocommerce_placeholder_img_src');
function custom_woocommerce_placeholder_img_src( $src ) {
@krogsgard
krogsgard / standard-woocommerce-product-loop-html-output.html
Created June 29, 2012 04:59
markup desired for WooCommerce product loop
<li class="product">
<a href="http://wp.com/shop/product-title/">
<img width="150" height="150" src="http://wp.com/wp-content/uploads/2012/06/IMAGE-150x150.jpg" class="attachment-shop_catalog wp-post-image" alt="ACCUTACT ANGLESIGHT" title="ACCUTACT ANGLESIGHT">
<h3>Product Title</h3>
<span class="price"><span class="amount">&#36;250</span></span>
@krogsgard
krogsgard / events-labels.php
Created June 22, 2012 16:03
Change The Events Calendar labels
<?php
add_filter( 'gettext', 'krogs_event_change_venue_name', 20, 3 );
/**
* Change comment form default field names.
*
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
*/
function krogs_event_change_venue_name( $translated_text, $text, $domain ) {
<?php
/**
* Add function to widgets_init that'll load our widget.
* @since 0.1
*/
add_action( 'widgets_init', 'latest_load_widgets' );
/**
* Register our widget.
* 'Latest_Tweet_Widget' is the widget class used below.
@krogsgard
krogsgard / query-posts-page-template
Created March 7, 2012 05:07
query_posts in page template
<?php $args = array(
'post_type' => array ( 'post', 'page' ),
'posts_per_page' => 1,
'paged' => ( get_query_var('page') ? get_query_var('page') : 1 )
); ?>
<?php query_posts( $args ); ?>
<?php if ( have_posts() ) : ?>
@krogsgard
krogsgard / arcticle
Created February 21, 2012 02:06
Twenty Eleven Loop
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
@krogsgard
krogsgard / wordpress-loop
Created February 20, 2012 04:45
The Basic WordPress Loop
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php // You can do stuff here to display aspects of the posts which meet the criteria of the current loop. ?>
<?php endwhile; else: ?>
<p><?php _e('The Loop did not find anything.'); ?></p>
<?php endif; ?>