This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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">$250</span></span> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* This snippet removes the action that inserts thumbnails to products in teh loop | |
* and re-adds the function customized with our wrapper in it. | |
* It applies to all archives with products. | |
* | |
* @original plugin: WooCommerce | |
* @author of snippet: Brian Krogsard | |
*/ | |
remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Displays a list of terms for a specific taxonomy. | |
* Based on Justin Tadlock's [entry-terms] shortcode | |
* Added attribute to not link to the taxonomy | |
* using wp_get_object_terms() to do so | |
* | |
* @author Brian Krogsgard | |
* | |
* @access public |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// check for '_my_custom_field' meta key on pages and page parents and add a body class if meta value equals 'some-value' | |
add_filter('body_class','krogs_custom_field_body_class'); | |
function krogs_custom_field_body_class( $classes ) { | |
global $post; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* WordPress Sample function and action | |
* for loading scripts in themes | |
*/ | |
// Let's hook in our function with the javascript files with the wp_enqueue_scripts hook | |
add_action( 'wp_enqueue_scripts', 'wpcandy_load_javascript_files' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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() ) : ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="info-box"> | |
<?php $krogsquery = new WP_Query( array( | |
'post_type' => 'post', | |
'posts_per_page' => 3 | |
)); ?> | |
<h3 class="info-headline">City News</h3> | |
<?php while($krogsquery->have_posts()) : $krogsquery->the_post(); ?> |