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
/* Daniel Ott | |
* entities.css | |
* 31 January 2011 | |
* | |
* Adding arrows to thinks makes them more clickable. Right? | |
* Use CSS's :after pseudo-selector to insert hexadecimal values | |
* of html entities into the document. Less markup. More awesome. | |
*/ | |
.add-an-arrow:after { |
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 | |
/** | |
* get_columns_array | |
* | |
* Columns for the loop, single function interface (limited) | |
* | |
* Copyright (c) 2011 hakre <http://hakre.wordpress.com/>, some rights reserved | |
* | |
* USAGE: |
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 | |
// Register the post type and taxonomy | |
function init_product_cpt() { | |
register_post_type( 'product', array( | |
'public' => true, | |
'label' => __( 'Products', 'my-plugin' ) | |
) ); | |
register_taxonomy( 'color', 'product', array( |
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 | |
/** | |
* Also show custom post types in tag/category/archive pages | |
*/ | |
function query_post_type($query) { | |
if(is_category() || is_tag()) { | |
$post_type = get_query_var('post_type'); | |
if($post_type) { | |
$post_type = $post_type; | |
} else { |
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 | |
/* | |
Template Name: Print Processing Orders :) | |
*/ | |
if (!is_user_logged_in() || !current_user_can('manage_options')) wp_die('This page is private.'); | |
?> | |
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
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
add_filter('woocommerce_paypal_icon', 'custom_woocommerce_paypal_icon') | |
function custom_woocommerce_paypal_icon( $url ) { | |
$url = 'http://yoursite,com/youriconurl.png'; | |
return $url; | |
} |
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
add_action( 'show_user_profile', 'show_extra_profile_fields', 10 ); | |
add_action( 'edit_user_profile', 'show_extra_profile_fields', 10 ); | |
function show_extra_profile_fields( $user ) { ?> | |
<h3><?php _e('Extra Profile Information'); ?></h3> | |
<table class="form-table"> | |
<tr> |
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
/* To use: | |
1. Add this snippet to your theme's functions.php file | |
2. Change the meta key names in the snippet | |
3. Create a custom field in the order post - e.g. key = "Tracking Code" value = abcdefg | |
4. When next updating the status, or during any other event which emails the user, they will see this field in their email | |
*/ | |
add_filter('woocommerce_email_order_meta_keys', 'my_custom_order_meta_keys'); | |
function my_custom_order_meta_keys( $keys ) { | |
$keys[] = 'Tracking Code'; // This will look for a custom field called 'Tracking Code' and add it to emails |
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
/** | |
* Add the field to the checkout | |
**/ | |
add_action('woocommerce_after_order_notes', 'my_custom_checkout_field'); | |
function my_custom_checkout_field( $checkout ) { | |
echo '<div id="my_custom_checkout_field"><h3>'.__('My Field').'</h3>'; | |
/** |
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
/** | |
* This code should be added to functions.php of your theme | |
**/ | |
add_filter('woocommerce_default_catalog_orderby', 'custom_default_catalog_orderby'); | |
function custom_default_catalog_orderby() { | |
return 'date'; // Can also use title and price | |
} | |
OlderNewer