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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{HTTPS} !=on | |
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] | |
RewriteRule ^index\.php$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . /index.php [L] | |
</IfModule> |
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 | |
/** | |
* Order Export | |
* Within the Custom Formats > Column Mapping, add your custom column name and set the Data Source to Static, and leave the Value field blank (since we set it here instead anyway) | |
* This function sees if your order or line item had any tax, and if so, it fills your custom column with "Taxed". Otherwise, the column will say "Not Taxed". | |
*/ | |
function fs_wc_csv_export_trim_data( $order_data ) { | |
for( $i = 0; $i < count( $order_data ); $i++ ) { | |
if ( isset( $order_data[ $i ]['order_line/tax_id/id'] ) ) { |
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 | |
/** | |
* Order Export | |
* Within the Custom Formats > Column Mapping, add your custom column name and set the Data Source to Static, and leave the Value field blank (since we set it here instead anyway) | |
* This function takes that custom field (based on the name you set it to) and then finds the user associated with the order (based on the customer_id of the order), and then displays the user's custom field you specify. | |
*/ | |
// Tweak content of certain fields in the order export | |
function fs_wc_csv_export_trim_data( $order_data ) { | |
for( $i = 0; $i < count( $order_data ); $i++ ) { |
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 the times and days to the body classes | |
// e.g., date-day-wednesday date-ymd-20170614 date-month-june time-military-1317 time-pm time-early-afternoon | |
add_filter( 'body_class', 'add_date_info_to_class_names' ); | |
function add_date_info_to_class_names( $classes ) { | |
// current day of week name | |
$classes[] = 'date-day-' . strtolower(date_i18n('l')); | |
// current full date YYYYMMDD | |
$classes[] = 'date-ymd-' . strtolower(date_i18n('Ymd')); |
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 | |
// let's add a CUSTOM IMAGE SIZE that can be used for featured product images within the emails | |
add_action( 'after_setup_theme', 'add_email_featured_img_size' ); | |
function add_email_featured_img_size() { | |
add_image_size( 'email-featured-thumb', 130, 130, true ); // (cropped) | |
} | |
// add custom content to END OF EMAIL | |
add_action( 'woocommerce_email_footer', 'add_footer_content'); |
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 | |
function default_category_featured_image() { | |
global $post; | |
$featured_image_exists = has_post_thumbnail($post->ID); | |
$terms = get_the_terms($post->ID, 'jobtype'); | |
$number = sizeof ($terms); | |
if (!$featured_image_exists) { | |
$attached_image = get_children( "post_parent=$post->ID&post_type=attachment&post_mime_type=image&numberposts=1" ); | |
if ($attached_image) { |
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 Custom Column Headers | |
function wc_csv_export_modify_column_headers( $column_headers ) { | |
$new_headers = array( | |
'carrier' => 'Carrier', | |
'line_number' => 'Line Number', | |
// add other column headers here in the format column_key => Column Name | |
); |
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 | |
/* Usage: | |
[fs-local-type type="wordpress"] | |
You can add additional parameters to the shortcode to override settings | |
Note: "local-type" is the name of the Taxonomy, and "wordpress" is the name of one of the terms | |
*/ | |
// create shortcode to list all Local Types | |
add_shortcode( 'fs-local-type', 'fs_local_type_shortcode' ); |
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 custom Local taxonomies | |
* This basically lets you create Categories for Pages (similar to what you can do for Posts) | |
* | |
* Additional custom taxonomies can be defined here | |
* http://codex.wordpress.org/Function_Reference/register_taxonomy | |
*/ | |
function fs_add_local_page_taxonomies() { |
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 an automatic default custom taxonomy for custom post type. | |
* If no taxonomy term is selected during post creation, the custom post will be assigned the specififed taxonomy terms during save. | |
* Just change the 'your-cpt-type' to your custom post type name | |
* and change 'fruit_tags' and 'soda_flavors' to the taxonomy slug(s) you want to target | |
* and change 'apple' and 'banana' and 'cola' with the slug(s) of the term(s) you want to make default | |
* you can add multiple taxonomy at once so the 'soda_flavors' line is applicable only then | |
*/ |
OlderNewer